mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-15 02:35:47 +00:00
26 lines
No EOL
631 B
PowerShell
26 lines
No EOL
631 B
PowerShell
function ConvertTo-GetParameter {
|
|
<#
|
|
.SYNOPSIS
|
|
Generate the GET parameter string for an URL from a hashtable
|
|
#>
|
|
[CmdletBinding()]
|
|
param (
|
|
[Parameter( Position = 0, Mandatory = $true, ValueFromPipeline = $true )]
|
|
[hashtable]$InputObject
|
|
)
|
|
|
|
BEGIN {
|
|
[string]$parameters = "?"
|
|
}
|
|
|
|
PROCESS {
|
|
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Making HTTP get parameter string out of a hashtable"
|
|
foreach ($key in $InputObject.Keys) {
|
|
$parameters += "$key=$($InputObject[$key])&"
|
|
}
|
|
}
|
|
|
|
END {
|
|
$parameters -replace ".$"
|
|
}
|
|
} |