Advertisement
Guest User

Untitled

a guest
May 29th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. $releaseArray = @()
  2. if (![string]::IsNullOrWhitespace($release))
  3. {
  4. $releaseArray = $release.split("{|}", [System.StringSplitOptions]::RemoveEmptyEntries)
  5. $releaseArray.gettype() | Select-Object Name
  6. if($releaseArray.Count -gt 0) {
  7. $namePathArray = @{}
  8. foreach($namePath in $releaseArray) {
  9. $splitReleaseArray = $namePath.split("{,}", [System.StringSplitOptions]::RemoveEmptyEntries)
  10. $namePathArray.add($splitReleaseArray[0], $splitReleaseArray[1])
  11. }
  12.  
  13. #here it echos propper hashtable
  14.  
  15. $namePathArray.gettype() | Select-Object Name
  16. if($namePathArray.Count -gt 0) {
  17. #here it echos propper hashtable as well
  18. return $namePathArray
  19. }
  20. }
  21. }
  22.  
  23. Name
  24. ----
  25. String[]
  26. test
  27. reorder
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement