Last active
July 10, 2018 14:50
-
-
Save Bigtalljosh/771a2c3fcf1e609179a8c8c5f0990c27 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
function Convert-HashToString | |
{ | |
param | |
( | |
[Parameter(Mandatory = $true)] | |
[System.Collections.Hashtable] | |
$Hash | |
) | |
$hashstr = "@{" | |
$keys = $Hash.keys | |
foreach ($key in $keys) | |
{ | |
$v = $Hash[$key] | |
if ($key -match "\s") | |
{ | |
$hashstr += "`"$key`"" + "=" + "`"$v`"" + ";" | |
} | |
else | |
{ | |
$hashstr += $key + "=" + "`"$v`"" + ";" | |
} | |
} | |
$hashstr += "}" | |
return $hashstr | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment