Created
September 21, 2016 07:26
-
-
Save kmhuglen/fb66e63389f1d81694e3e5c771db211b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$UserInput= '{UserInput from "Get Incident Request"}' | |
$nl = [Environment]::NewLine | |
$content=[XML]$UserInput | |
$inputs = $content.UserInputs.UserInput | |
foreach ($input in $inputs) | |
{ | |
if($($input.Answer) -like "<value*") | |
{ | |
[xml]$answer = $input.answer | |
foreach($value in $($($answer.values))) | |
{ | |
foreach($item in $value) | |
{ | |
foreach ($txt in $($item.value)) | |
{ | |
$ListArray += $($txt.DisplayName) | |
} | |
$Array += $input.Question + " = " + [string]::Join(" ; ",$ListArray) +$nl | |
$ListArray = $null | |
} | |
} | |
} | |
else | |
{ | |
if ($input.type -eq "enum") | |
{ | |
$ListGuid = Get-SCSMEnumeration -Id $input.Answer | |
$Array += $($input.Question + " = " + $ListGuid.displayname) +$nl | |
} | |
else | |
{ | |
$Array += $($input.Question + " = " + $input.Answer) +$nl | |
} | |
} | |
} | |
$Array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment