Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- param($url = "")
- $channel = @"
- <result>
- <channel>{0}</channel>
- <value>{1}</value>
- </result>
- "@
- $Sessions = ((Invoke-WebRequest -UseBasicParsing $url))
- $Sessions = "Instance,State,Sessions,Path`r`n" + $Sessions -replace ":",","
- $Sessions = $Sessions -creplace "C,","C:"
- $Sessions = $Sessions -creplace "D,","D:"
- $Sessions = $Sessions -creplace "E,","E:"
- Write-Host "<prtg>";
- Foreach($Session in ($Sessions | ConvertFrom-Csv))
- { Write-Host ($channel -f $Session.Instance,$Session.Sessions); }
- Write-Host "</prtg>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement