Off-Topic > The Pit
The True OP object....
Lord Dick Tim:
Now we just need a thread filled solely with code.
Shinkurex:
#Copying report to reports folder
cd "c:\Users\nathan.pettit\Downloads\"
$report = (ls | sort "LastWriteTime" -Descending)[0]
move $report C:\Users\nathan.pettit\Documents\Reports\T1-Cases\
# Changing directory to grab the report
cd "C:\Users\nathan.pettit\Documents\Reports\T1-Cases"
# Variables
$OldCSVFile = (ls | ?{$_.CreationTime.ToShortDateString()})[0]
$NewCSVFile = (ls | ?{$_.CreationTime.ToShortDateString()})[-1]
$Engineers = @{}
$Data = Import-Csv $NewCSVFile -Delimiter "," | ?{$_."Case Owner" -notlike "Cases Taken In a Day" -and $_."Case Owner" -notlike "Copyright (c) 2000-2013 salesforce.com, inc. All rights reserved." -and $_."Case Owner" -notlike "Confidential Information - Do Not Distribute" -and $_."Case Owner" -notmatch "Generated By: Nathan Pettit " -and $_."Case Owner" -notlike "Veeam" -and $_."Case Owner" -notlike ""}
# Getting list of owners
foreach($ticket in $Data){
if(!($Engineers.ContainsKey($ticket."Case Owner"))){
$Engineers.Add($ticket."Case Owner", (New-Object System.Collections.ArrayList))
}
}
foreach($ticket in $Data)
{
if(!($Engineers.($ticket."Case Owner").Contains($ticket."Case Number")))
{
[Void]($Engineers.($ticket."Case Owner").Add($ticket."Case Number"))
}
}
$total = 0
$EngineerCallData = $Engineers.Clone()
$RawReport = @()
foreach($engineer in $Engineers.Keys)
{
$EngineerCallData.($engineer) = $Engineers.($engineer).Count
$total += $Engineers.($engineer).Count
$row = "" | Select Name, TicketCount
$row.Name += ($engineer).ToString()
$row.TicketCount += ($Engineers.($engineer).Count)
$RawReport += $row
}
$RawReport | sort "TicketCount" -Descending
good?
HamsterIV:
- .... . ... -.- -.-- .-- .... .- .-.. . .-- .- ... .-.. .- ... - ... .--. --- - - . -.. .... . .- -.. .. -. --. . .- ... - .. -. - --- - .... . -... .- .-. .-. . -. ... .-.-.- .-. . .--. --- .-. - ... .. -. -.. .. -.-. .- - . .. - .--. .- ... ... . -.. --- ...- . .-. .- -.-. .- .-. .- ...- .- -. ..-. .-. --- -- -. .- .-.. -- --..-- - .... . .-. . .-- . .-. . -. --- ... ..- .-. ...- .. ...- --- .-. ... .-.-.-
N-Sunderland:
--- Quote from: HamsterIV on March 22, 2013, 11:40:49 am ---- .... . ... -.- -.-- .-- .... .- .-.. . .-- .- ... .-.. .- ... - ... .--. --- - - . -.. .... . .- -.. .. -. --. . .- ... - .. -. - --- - .... . -... .- .-. .-. . -. ... .-.-.- .-. . .--. --- .-. - ... .. -. -.. .. -.-. .- - . .. - .--. .- ... ... . -.. --- ...- . .-. .- -.-. .- .-. .- ...- .- -. ..-. .-. --- -- -. .- .-.. -- --..-- - .... . .-. . .-- . .-. . -. --- ... ..- .-. ...- .. ...- --- .-. ... .-.-.-
--- End quote ---
Why no survivors?
HamsterIV:
The Sky Whale is a soulless killing machine. Concepts like of mercy and honor are as alien to its mind as what ever the dark yearnings that drive it on are alien to ours. To a Sky Whale we are mere play things to be toyed with and later smashed for its amusement. Know that this planet is no longer the dominion of man, that creatures wander the skies to whom we are but ants.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version