August 20, 2015 at 10:53 am
hi,
i am using powershell to get the output
I am planning implement sorting to my output.below is the format I am writing my objects to html file.
I want sort the object of lastrunoutocome field.
can anyone suggest please
foreach($item in $sqlServer.JobServer.Jobs)
{
Write-Host $sqlserver $item.name $item.OwnerLoginName $item.IsEnabled $item.LastRunDate $item.LastRunOutcome
writeDiskInfo $ServiceFileName $sqlServer $item.name $item.OwnerLoginName
}
August 20, 2015 at 11:18 am
foreach($item in $sqlServer.JobServer.Jobs)
{
Write-Host $sqlserver $item.name $item.OwnerLoginName $item.IsEnabled $item.LastRunDate $item.LastRunOutcome
writeDiskInfo $ServiceFileName $sqlServer $item.name $item.OwnerLoginName
}
I don't see anywhere in this that you are writing to HTML, also what does "writeDiskInfo" command do with the values you are passing into it?
You can use "sort-object" through the pipeline to sort the objects before piping to an output.
Shawn Melton
Twitter: @wsmelton
Blog: wsmelton.github.com
Github: wsmelton
August 20, 2015 at 5:31 pm
I guess my question would be... why on Earth are you doing this in PowerShell?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply