Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@itpropro
Last active April 20, 2021 11:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itpropro/69f8a0ef50d2ec11e3dbd0931daebae2 to your computer and use it in GitHub Desktop.
Save itpropro/69f8a0ef50d2ec11e3dbd0931daebae2 to your computer and use it in GitHub Desktop.
$xmlpath = 'C:\Temp\DeploymentConfigTemplate.xml'
$features = New-Object -TypeName System.Collections.ArrayList
[xml]$xml = Get-Content $xmlpath
$xml.Objs.Obj.LST.Obj | ForEach-Object {$null = $features.Add($_.GetElementsByTagName('ToString').'#text')}
for ($i = 0; $i -lt $features.Count; $i++)
{
$features[$i] = $features[$i].Substring($features[$i].IndexOf('_') + 1).Replace('_','-')
}
$features
@shivakumarky
Copy link

Useful to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment