mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-17 03:35:47 +00:00
Compare commits
49 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d14244d727 | ||
|
|
fadfa2d797 | ||
|
|
3a5d951cb9 | ||
|
|
7582b0fa1a | ||
|
|
381b6e3586 | ||
|
|
79b94981ec | ||
|
|
6b3bc0f459 | ||
|
|
4a889cfb44 | ||
|
|
98095b6a53 | ||
|
|
758c5140b6 | ||
|
|
d70f22d5f5 | ||
|
|
5feafa0574 | ||
|
|
72215faf0b | ||
|
|
8af189e95b | ||
|
|
56a4525230 | ||
|
|
32c95f8077 | ||
|
|
cc475abf8c | ||
|
|
f3391bb521 | ||
|
|
5aa6a2eed5 | ||
|
|
452573c9a0 | ||
|
|
72c6ccbd38 | ||
|
|
e321cd3fa1 | ||
|
|
b4c2b51024 | ||
|
|
f26db93a16 | ||
|
|
51cb9f88f5 | ||
|
|
68ae039013 | ||
|
|
9e014ad06b | ||
|
|
7ac8a5c9bd | ||
|
|
e2923cade8 | ||
|
|
e10f520008 | ||
|
|
4e4a739418 | ||
|
|
2f1873497d | ||
|
|
db2fb6278c | ||
|
|
536bff19bb | ||
|
|
ec40912018 | ||
|
|
83e8e43bc2 | ||
|
|
26ae35d1bd | ||
|
|
2a6d62bff5 | ||
|
|
dd2bf7371e | ||
|
|
612d08c5d3 | ||
|
|
d224f97d73 | ||
|
|
0f7e6b3fc6 | ||
|
|
10e87b48cc | ||
|
|
b5fe626f6c | ||
|
|
b90e1a94ea | ||
|
|
3f39425a6c | ||
|
|
422cf7b32e | ||
|
|
bc88c6d8cf | ||
|
|
bc48d74650 |
149 changed files with 857 additions and 349 deletions
|
|
@ -38,13 +38,21 @@ function Invoke-SnipeitMethod {
|
||||||
if ( $null -ne $SnipeitPSSession.legacyUrl -and $null -ne $SnipeitPSSession.legacyApiKey ) {
|
if ( $null -ne $SnipeitPSSession.legacyUrl -and $null -ne $SnipeitPSSession.legacyApiKey ) {
|
||||||
[string]$Url = $SnipeitPSSession.legacyUrl
|
[string]$Url = $SnipeitPSSession.legacyUrl
|
||||||
Write-Debug "Invoke-SnipeitMethod url: $Url"
|
Write-Debug "Invoke-SnipeitMethod url: $Url"
|
||||||
$Token = ConvertFrom-SecureString -AsPlainText -SecureString $SnipeitPSSession.legacyApiKey
|
if($PSVersionTable.PSVersion -ge '7.0'){
|
||||||
|
$Token = ConvertFrom-SecureString -AsPlainText -SecureString $SnipeitPSSession.legacyApiKey
|
||||||
|
} else {
|
||||||
|
#convert to plaintext via credential
|
||||||
|
$Token = (New-Object PSCredential "user",$SnipeitPSSession.legacyApiKey).GetNetworkCredential().Password
|
||||||
|
}
|
||||||
} elseif ($null -ne $SnipeitPSSession.url -and $null -ne $SnipeitPSSession.apiKey) {
|
} elseif ($null -ne $SnipeitPSSession.url -and $null -ne $SnipeitPSSession.apiKey) {
|
||||||
[string]$Url = $SnipeitPSSession.url
|
[string]$Url = $SnipeitPSSession.url
|
||||||
Write-Debug "Invoke-SnipeitMethod url: $Url"
|
Write-Debug "Invoke-SnipeitMethod url: $Url"
|
||||||
$Token = ConvertFrom-SecureString -AsPlainText -SecureString $SnipeitPSSession.apiKey
|
if($PSVersionTable.PSVersion -ge '7.0'){
|
||||||
|
$Token = ConvertFrom-SecureString -AsPlainText -SecureString $SnipeitPSSession.apiKey
|
||||||
|
} else {
|
||||||
|
#convert to plaintext via credential
|
||||||
|
$Token = (New-Object PSCredential "user",$SnipeitPSSession.apiKey).GetNetworkCredential().Password
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw "Please use Connect-SnipeitPS to setup connection before any other commands."
|
throw "Please use Connect-SnipeitPS to setup connection before any other commands."
|
||||||
}
|
}
|
||||||
|
|
@ -110,6 +118,58 @@ function Invoke-SnipeitMethod {
|
||||||
|
|
||||||
Write-Debug "$($Body | ConvertTo-Json)"
|
Write-Debug "$($Body | ConvertTo-Json)"
|
||||||
|
|
||||||
|
#Check throttle limit
|
||||||
|
if ($SnipeitPSSession.throttleLimit -gt 0) {
|
||||||
|
Write-Verbose "Check for request throttling"
|
||||||
|
Write-debug "ThrottleMode: $($SnipeitPSSession.throttleMode)"
|
||||||
|
Write-debug "ThrottleLimit: $($SnipeitPSSession.throttleLimit)"
|
||||||
|
Write-debug "ThrottlePeriod: $($SnipeitPSSession.throttlePeriod)"
|
||||||
|
Write-debug "ThrottleThreshold: $($SnipeitPSSession.throttleThreshold)"
|
||||||
|
Write-debug "Current count: $($SnipeitPSSession.throttledRequests.count)"
|
||||||
|
|
||||||
|
#current request timestamps in period
|
||||||
|
$SnipeitPSSession.throttledRequests = ($SnipeitPSSession.throttledRequests).where({$_ -gt (get-date).AddMilliseconds( 0 - $SnipeitPSSession.throttlePeriod).ToFileTime()})
|
||||||
|
|
||||||
|
#make sure that we alway have list here
|
||||||
|
if($null -eq $SnipeitPSSession.throttledRequests) {
|
||||||
|
$SnipeitPSSession.throttledRequests = [System.Collections.ArrayList]::new()
|
||||||
|
}
|
||||||
|
|
||||||
|
$naptime = 0
|
||||||
|
switch ($SnipeitPSSession.throttleMode) {
|
||||||
|
"Burst" {
|
||||||
|
if ($SnipeitPSSession.throttledRequests.count -ge $SnipeitPSSession.throttleLimit) {
|
||||||
|
$naptime = [Math]::Round(((get-date).ToFileTime() - ($SnipeitPSSession.throttledRequests[0]))/10000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"Constant" {
|
||||||
|
$prevrequesttime =[Math]::Round(((get-date).ToFileTime() - ($SnipeitPSSession.throttledRequests[$SnipeitPSSession.throttledRequests.count - 1]))/10000)
|
||||||
|
$naptime = [Math]::Round($SnipeitPSSession.throttlePeriod / $SnipeitPSSession.throttleLimit) - $prevrequesttime
|
||||||
|
}
|
||||||
|
|
||||||
|
"Adaptive" {
|
||||||
|
$unThrottledRequests = $SnipeitPSSession.throttleLimit * ($SnipeitPSSession.throttleThreshold / 100)
|
||||||
|
if($SnipeitPSSession.throttledRequests.count -ge $unThrottledRequests) {
|
||||||
|
#calculate time left in throttlePeriod and devide it for remaining requests
|
||||||
|
$remaining = $SnipeitPSSession.throttleLimit - $SnipeitPSSession.throttledRequests.count
|
||||||
|
if ($remaining -lt 1) {
|
||||||
|
$remaining = 1
|
||||||
|
}
|
||||||
|
$naptime = [Math]::Round((((get-date).ToFileTime() - ($SnipeitPSSession.throttledRequests[0]))/ 10000) / $remaining)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Do we need a nap
|
||||||
|
if ($naptime -gt 0) {
|
||||||
|
Write-verbose "Throttling request for $naptime ms"
|
||||||
|
Start-Sleep -Milliseconds $naptime
|
||||||
|
}
|
||||||
|
|
||||||
|
$SnipeitPSSession.throttledRequests.Add((Get-Date).ToFileTime())
|
||||||
|
}
|
||||||
|
|
||||||
# Invoke the API
|
# Invoke the API
|
||||||
try {
|
try {
|
||||||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Invoking method $Method to URI $URi"
|
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Invoking method $Method to URI $URi"
|
||||||
|
|
@ -136,6 +196,10 @@ function Invoke-SnipeitMethod {
|
||||||
# This could be handled nicely in an function such as:
|
# This could be handled nicely in an function such as:
|
||||||
# ResolveError $response -WriteError
|
# ResolveError $response -WriteError
|
||||||
Write-Error $($webResponse.messages | Out-String)
|
Write-Error $($webResponse.messages | Out-String)
|
||||||
|
} elseif ( $webResponse.StatusCode -eq 'Unauthorized') {
|
||||||
|
Write-Verbose "[$($MyInvocation.MyCommand.Name)] An Unauthorized response was received"
|
||||||
|
Write-Error "Cannot connect to Snipe It: Unauthorized."
|
||||||
|
return $false
|
||||||
} else {
|
} else {
|
||||||
#update operations return payload
|
#update operations return payload
|
||||||
if ($webResponse.payload) {
|
if ($webResponse.payload) {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,11 @@ function Set-SnipeitPSLegacyApiKey {
|
||||||
)
|
)
|
||||||
process {
|
process {
|
||||||
if ($PSCmdlet.ShouldProcess("ShouldProcess?")) {
|
if ($PSCmdlet.ShouldProcess("ShouldProcess?")) {
|
||||||
$SnipeitPSSession.legacyApiKey = ConvertTo-SecureString -AsPlainText -String $apiKey
|
if($PSVersionTable.PSVersion -ge '7.0'){
|
||||||
|
$SnipeitPSSession.legacyApiKey = ConvertTo-SecureString -AsPlainText -String $apiKey
|
||||||
|
} else {
|
||||||
|
$SnipeitPSSession.legacyApiKey = ConvertTo-SecureString -Force -AsPlainText -String $apiKey
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,22 @@
|
||||||
PSCredential where username shoul be snipe it url and password should be
|
PSCredential where username shoul be snipe it url and password should be
|
||||||
snipe it apikey.
|
snipe it apikey.
|
||||||
|
|
||||||
|
.PARAMETER throttleLimit
|
||||||
|
Throttle request rate to nro of requests per throttlePeriod. Defaults to 0 that means no requests are not throttled.
|
||||||
|
|
||||||
|
.PARAMETER throttlePeriod
|
||||||
|
Throttle period time span in milliseconds defaults to 60 milliseconds.
|
||||||
|
|
||||||
|
.PARAMETER throttleThreshold
|
||||||
|
Threshold percentage of used request on period after request are throttled.
|
||||||
|
|
||||||
|
.PARAMETER throttleMode
|
||||||
|
RequestThrottling type. "Burst" allows all requests to be used in ThrottlePeriod without delays and then waits
|
||||||
|
until there's new requests avalable. With "Contant" mode there always delay between requests. Delay is calculated
|
||||||
|
by dividing throttlePeriod with throttleLimit. "Adaptive" mode allows throttleThreshold percentage of request to be
|
||||||
|
used with out delay, after threshold limit is reached next requests are delayded by dividing available requests
|
||||||
|
over throttlePeriod.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Connect-SnipeitPS -Url $url -apiKey $myapikey
|
Connect-SnipeitPS -Url $url -apiKey $myapikey
|
||||||
Connect to Snipe it api.
|
Connect to Snipe it api.
|
||||||
|
|
@ -61,7 +77,28 @@ function Connect-SnipeitPS {
|
||||||
[SecureString]$secureApiKey,
|
[SecureString]$secureApiKey,
|
||||||
|
|
||||||
[Parameter(ParameterSetName='Connect with credential',Mandatory=$true)]
|
[Parameter(ParameterSetName='Connect with credential',Mandatory=$true)]
|
||||||
[PSCredential]$siteCred
|
[PSCredential]$siteCred,
|
||||||
|
|
||||||
|
[Parameter(ParameterSetName='Connect with url and apikey',Mandatory=$false)]
|
||||||
|
[Parameter(ParameterSetName='Connect with url and secure apikey',Mandatory=$false)]
|
||||||
|
[Parameter(ParameterSetName='Connect with credential',Mandatory=$false)]
|
||||||
|
[int]$throttleLimit,
|
||||||
|
|
||||||
|
[Parameter(ParameterSetName='Connect with url and apikey',Mandatory=$false)]
|
||||||
|
[Parameter(ParameterSetName='Connect with url and secure apikey',Mandatory=$false)]
|
||||||
|
[Parameter(ParameterSetName='Connect with credential',Mandatory=$false)]
|
||||||
|
[int]$throttlePeriod,
|
||||||
|
|
||||||
|
[Parameter(ParameterSetName='Connect with url and apikey',Mandatory=$false)]
|
||||||
|
[Parameter(ParameterSetName='Connect with url and secure apikey',Mandatory=$false)]
|
||||||
|
[Parameter(ParameterSetName='Connect with credential',Mandatory=$false)]
|
||||||
|
[int]$throttleThreshold,
|
||||||
|
|
||||||
|
[Parameter(ParameterSetName='Connect with url and apikey',Mandatory=$false)]
|
||||||
|
[Parameter(ParameterSetName='Connect with url and secure apikey',Mandatory=$false)]
|
||||||
|
[Parameter(ParameterSetName='Connect with credential',Mandatory=$false)]
|
||||||
|
[ValidateSet("Burst","Constant","Adaptive")]
|
||||||
|
[string]$throttleMode
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -69,7 +106,11 @@ function Connect-SnipeitPS {
|
||||||
switch ($PsCmdlet.ParameterSetName) {
|
switch ($PsCmdlet.ParameterSetName) {
|
||||||
'Connect with url and apikey' {
|
'Connect with url and apikey' {
|
||||||
$SnipeitPSSession.url = $url.AbsoluteUri.TrimEnd('/')
|
$SnipeitPSSession.url = $url.AbsoluteUri.TrimEnd('/')
|
||||||
$SnipeitPSSession.apiKey = ConvertTo-SecureString -AsPlainText -String $apiKey
|
if($PSVersionTable.PSVersion -ge '7.0'){
|
||||||
|
$SnipeitPSSession.apiKey = ConvertTo-SecureString -AsPlainText -String $apiKey
|
||||||
|
} else {
|
||||||
|
$SnipeitPSSession.apiKey = ConvertTo-SecureString -String $apiKey -AsPlainText -Force
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
'Connect with url and secure apikey' {
|
'Connect with url and secure apikey' {
|
||||||
|
|
@ -82,6 +123,21 @@ function Connect-SnipeitPS {
|
||||||
$SnipeitPSSession.apiKey = $siteCred.GetNetworkCredential().SecurePassword
|
$SnipeitPSSession.apiKey = $siteCred.GetNetworkCredential().SecurePassword
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($null -eq $throttleLimit) { $throttleLimit = 0}
|
||||||
|
$SnipeitPSSession.throttleLimit = $throttleLimit
|
||||||
|
|
||||||
|
if($throttleThreshold -lt 1) { $throttleThreshold = 90}
|
||||||
|
$SnipeitPSSession.throttleThreshold = $throttleThreshold
|
||||||
|
|
||||||
|
if('' -eq $throttleMode) { $throttleMode = "Burst"}
|
||||||
|
$SnipeitPSSession.throttleMode = $throttleMode
|
||||||
|
|
||||||
|
if ($SnipeitPSSession.throttleLimit -gt 0) {
|
||||||
|
if($null -eq $throttlePeriod) { $throttlePeriod = 60000}
|
||||||
|
$SnipeitPSSession.throttlePeriod = $throttlePeriod
|
||||||
|
|
||||||
|
$SnipeitPSSession.throttledRequests = [System.Collections.ArrayList]::new()
|
||||||
|
}
|
||||||
|
|
||||||
Write-Debug "Site-url $($SnipeitPSSession.url)"
|
Write-Debug "Site-url $($SnipeitPSSession.url)"
|
||||||
Write-Debug "Site apikey: $($SnipeitPSSession.apiKey)"
|
Write-Debug "Site apikey: $($SnipeitPSSession.apiKey)"
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,24 @@ Gets a list of Snipe-it Accessories
|
||||||
.PARAMETER search
|
.PARAMETER search
|
||||||
A text string to search the Accessory data
|
A text string to search the Accessory data
|
||||||
|
|
||||||
|
.PARAMETER user_id
|
||||||
|
Return Accessories checked out to user id
|
||||||
|
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific Accessory
|
A id of specific Accessory
|
||||||
|
|
||||||
|
.PARAMETER company_id
|
||||||
|
Optionally restrict Accessory results to this company_id field
|
||||||
|
|
||||||
|
.PARAMETER category_id
|
||||||
|
Optionally restrict Accessory results to this category_id field
|
||||||
|
|
||||||
|
.PARAMETER manufacturer_id
|
||||||
|
Optionally restrict Accessory results to this manufacturer_id field
|
||||||
|
|
||||||
|
.PARAMETER supplier_id
|
||||||
|
Optionally restrict Accessory results to this supplier_id field
|
||||||
|
|
||||||
.PARAMETER limit
|
.PARAMETER limit
|
||||||
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
||||||
|
|
||||||
|
|
@ -102,12 +117,12 @@ function Get-SnipeitAccessory() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -137,7 +152,7 @@ function Get-SnipeitAccessory() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,12 @@ function Get-SnipeitAccessoryOwner() {
|
||||||
Method = 'GET'
|
Method = 'GET'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -57,7 +57,7 @@ function Get-SnipeitAccessoryOwner() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,12 +97,12 @@ function Get-SnipeitActivity() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -132,7 +132,7 @@ function Get-SnipeitActivity() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,21 @@ Retrieve a list of assets that are due for auditing soon.
|
||||||
.PARAMETER audit_overdue
|
.PARAMETER audit_overdue
|
||||||
Retrieve a list of assets that are overdue for auditing.
|
Retrieve a list of assets that are overdue for auditing.
|
||||||
|
|
||||||
|
.PARAMETER user_id
|
||||||
|
Retrieve a list of assets checked out to user id.
|
||||||
|
|
||||||
|
.PARAMETER component_id
|
||||||
|
Retrieve a list of assets assigned this component id.
|
||||||
|
|
||||||
|
.PARAMETER name
|
||||||
|
Optionally restrict asset results to this asset name
|
||||||
|
|
||||||
.PARAMETER order_number
|
.PARAMETER order_number
|
||||||
Optionally restrict asset results to this order number
|
Optionally restrict asset results to this order number
|
||||||
|
|
||||||
.PARAMETER model_id
|
.PARAMETER model_id
|
||||||
Optionally restrict asset results to this asset model ID
|
Optionally restrict asset results to this asset model ID
|
||||||
|
|
||||||
.PARAMETER category_id
|
.PARAMETER category_id
|
||||||
Optionally restrict asset results to this category ID
|
Optionally restrict asset results to this category ID
|
||||||
|
|
||||||
|
|
@ -38,12 +47,22 @@ Optionally restrict asset results to this company ID
|
||||||
.PARAMETER location_id
|
.PARAMETER location_id
|
||||||
Optionally restrict asset results to this location ID
|
Optionally restrict asset results to this location ID
|
||||||
|
|
||||||
|
.PARAMETER depreciation_id
|
||||||
|
Optionally restrict asset results to this depreciation ID
|
||||||
|
|
||||||
|
.PARAMETER requestable
|
||||||
|
Optionally restrict asset results to those set as requestable
|
||||||
|
|
||||||
.PARAMETER status
|
.PARAMETER status
|
||||||
Optionally restrict asset results to one of these status types: RTD, Deployed, Undeployable, Deleted, Archived, Requestable
|
Optionally restrict asset results to one of these status types: RTD, Deployed, Undeployable, Deleted, Archived, Requestable
|
||||||
|
|
||||||
.PARAMETER status_id
|
.PARAMETER status_id
|
||||||
Optionally restrict asset results to this status label ID
|
Optionally restrict asset results to this status label ID
|
||||||
|
|
||||||
|
.PARAMETER customfields
|
||||||
|
Hastable of custom fields and extra fields for searching assets in Snipe-It.
|
||||||
|
Use internal field names from Snipe-It. You can use Get-CustomField to get internal field names.
|
||||||
|
|
||||||
.PARAMETER sort
|
.PARAMETER sort
|
||||||
Specify the column name you wish to sort by
|
Specify the column name you wish to sort by
|
||||||
|
|
||||||
|
|
@ -132,6 +151,9 @@ function Get-SnipeitAsset() {
|
||||||
[parameter(ParameterSetName='Assets with component id')]
|
[parameter(ParameterSetName='Assets with component id')]
|
||||||
[int]$component_id,
|
[int]$component_id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$name,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[string]$order_number,
|
[string]$order_number,
|
||||||
|
|
||||||
|
|
@ -162,6 +184,9 @@ function Get-SnipeitAsset() {
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[int]$status_id,
|
[int]$status_id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[hashtable]$customfields,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[parameter(ParameterSetName='Assets due auditing soon')]
|
[parameter(ParameterSetName='Assets due auditing soon')]
|
||||||
[parameter(ParameterSetName='Assets overdue for auditing')]
|
[parameter(ParameterSetName='Assets overdue for auditing')]
|
||||||
|
|
@ -211,6 +236,15 @@ function Get-SnipeitAsset() {
|
||||||
|
|
||||||
$SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
|
$SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
|
||||||
|
|
||||||
|
# Add in custom fields.
|
||||||
|
if ($customfields.Count -gt 0) {
|
||||||
|
foreach ($pair in $customfields.GetEnumerator()) {
|
||||||
|
if (-Not $SearchParameter.ContainsKey($pair.Name)) {
|
||||||
|
$SearchParameter.Add($pair.Name, $pair.Value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch ($PsCmdlet.ParameterSetName) {
|
switch ($PsCmdlet.ParameterSetName) {
|
||||||
'Search' { $api = "/api/v1/hardware" }
|
'Search' { $api = "/api/v1/hardware" }
|
||||||
'Get with id' {$api= "/api/v1/hardware/$id"}
|
'Get with id' {$api= "/api/v1/hardware/$id"}
|
||||||
|
|
@ -228,12 +262,12 @@ function Get-SnipeitAsset() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -264,7 +298,7 @@ function Get-SnipeitAsset() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,12 +71,12 @@ function Get-SnipeitAssetMaintenance() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -106,7 +106,7 @@ function Get-SnipeitAssetMaintenance() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ A text string to search the Categories data
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific Category
|
A id of specific Category
|
||||||
|
|
||||||
|
.PARAMETER name
|
||||||
|
Optionally restrict Category results to this Category name.
|
||||||
|
|
||||||
.PARAMETER limit
|
.PARAMETER limit
|
||||||
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
||||||
|
|
||||||
|
|
@ -40,6 +43,9 @@ function Get-SnipeitCategory() {
|
||||||
[parameter(ParameterSetName='Get with ID')]
|
[parameter(ParameterSetName='Get with ID')]
|
||||||
[int]$id,
|
[int]$id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$name,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[ValidateSet("asc", "desc")]
|
[ValidateSet("asc", "desc")]
|
||||||
[string]$order = "desc",
|
[string]$order = "desc",
|
||||||
|
|
@ -81,12 +87,12 @@ function Get-SnipeitCategory() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -115,7 +121,7 @@ function Get-SnipeitCategory() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ A text string to search the Companies data
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific Company
|
A id of specific Company
|
||||||
|
|
||||||
|
.PARAMETER name
|
||||||
|
Optionally restrict company results to this company name.
|
||||||
|
|
||||||
.PARAMETER limit
|
.PARAMETER limit
|
||||||
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
||||||
|
|
||||||
|
|
@ -41,6 +44,9 @@ function Get-SnipeitCompany() {
|
||||||
[parameter(ParameterSetName='Get with ID')]
|
[parameter(ParameterSetName='Get with ID')]
|
||||||
[int]$id,
|
[int]$id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$name,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[ValidateSet("asc", "desc")]
|
[ValidateSet("asc", "desc")]
|
||||||
[string]$order = "desc",
|
[string]$order = "desc",
|
||||||
|
|
@ -82,12 +88,12 @@ function Get-SnipeitCompany() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +122,7 @@ function Get-SnipeitCompany() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,18 @@ A text string to search the Components data
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific Component
|
A id of specific Component
|
||||||
|
|
||||||
|
.PARAMETER name
|
||||||
|
Optionally restrict Component results to this name field
|
||||||
|
|
||||||
|
.PARAMETER company_id
|
||||||
|
Optionally restrict Component results to this company_id field
|
||||||
|
|
||||||
|
.PARAMETER category_id
|
||||||
|
Optionally restrict Component results to this category_id field
|
||||||
|
|
||||||
|
.PARAMETER location_id
|
||||||
|
Optionally restrict Component results to this location_id field
|
||||||
|
|
||||||
.PARAMETER limit
|
.PARAMETER limit
|
||||||
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
||||||
|
|
||||||
|
|
@ -45,6 +57,9 @@ function Get-SnipeitComponent() {
|
||||||
[parameter(ParameterSetName='Get with ID')]
|
[parameter(ParameterSetName='Get with ID')]
|
||||||
[int]$id,
|
[int]$id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$name,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[int]$category_id,
|
[int]$category_id,
|
||||||
|
|
||||||
|
|
@ -99,12 +114,12 @@ function Get-SnipeitComponent() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -134,7 +149,7 @@ function Get-SnipeitComponent() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ A text string to search the consumables
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific consumable
|
A id of specific consumable
|
||||||
|
|
||||||
|
.PARAMETER name
|
||||||
|
Optionally restrict consumable results to this name field
|
||||||
|
|
||||||
.PARAMETER company_id
|
.PARAMETER company_id
|
||||||
Id number of company
|
Id number of company
|
||||||
|
|
||||||
|
|
@ -63,6 +66,9 @@ function Get-SnipeitConsumable() {
|
||||||
[parameter(ParameterSetName='Get with ID')]
|
[parameter(ParameterSetName='Get with ID')]
|
||||||
[int[]]$id,
|
[int[]]$id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$name,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[int]$category_id,
|
[int]$category_id,
|
||||||
|
|
||||||
|
|
@ -106,12 +112,12 @@ function Get-SnipeitConsumable() {
|
||||||
|
|
||||||
$SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
|
$SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -164,7 +170,7 @@ function Get-SnipeitConsumable() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,12 @@ function Get-SnipeitCustomField() {
|
||||||
Method = 'Get'
|
Method = 'Get'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ function Get-SnipeitCustomField() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,18 @@ A text string to search the Departments data
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific Department
|
A id of specific Department
|
||||||
|
|
||||||
|
.PARAMETER name
|
||||||
|
Optionally restrict department results to this department name.
|
||||||
|
|
||||||
|
.PARAMETER manager_id
|
||||||
|
Optionally restrict department results to this manager ID.
|
||||||
|
|
||||||
|
.PARAMETER company_id
|
||||||
|
Optionally restrict department results to this company ID.
|
||||||
|
|
||||||
|
.PARAMETER location_id
|
||||||
|
Optionally restrict department results to this location ID.
|
||||||
|
|
||||||
.PARAMETER limit
|
.PARAMETER limit
|
||||||
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
||||||
|
|
||||||
|
|
@ -43,6 +55,18 @@ function Get-SnipeitDepartment() {
|
||||||
[parameter(ParameterSetName='Get with ID')]
|
[parameter(ParameterSetName='Get with ID')]
|
||||||
[int]$id,
|
[int]$id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$name,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[int]$manager_id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[int]$company_id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[int]$location_id,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[ValidateSet("asc", "desc")]
|
[ValidateSet("asc", "desc")]
|
||||||
[string]$order = "desc",
|
[string]$order = "desc",
|
||||||
|
|
@ -88,12 +112,12 @@ function Get-SnipeitDepartment() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -122,7 +146,7 @@ function Get-SnipeitDepartment() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ function Get-SnipeitFieldset() {
|
||||||
[parameter(mandatory = $false)]
|
[parameter(mandatory = $false)]
|
||||||
[string]$apiKey
|
[string]$apiKey
|
||||||
)
|
)
|
||||||
bagin {
|
begin {
|
||||||
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
|
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
|
||||||
|
|
||||||
if ($id) {
|
if ($id) {
|
||||||
|
|
@ -45,12 +45,12 @@ function Get-SnipeitFieldset() {
|
||||||
Method = 'Get'
|
Method = 'Get'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -62,7 +62,7 @@ function Get-SnipeitFieldset() {
|
||||||
}
|
}
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ function Get-SnipeitLicense() {
|
||||||
[parameter(mandatory = $false)]
|
[parameter(mandatory = $false)]
|
||||||
[string]$apiKey
|
[string]$apiKey
|
||||||
)
|
)
|
||||||
bagin {
|
begin {
|
||||||
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
|
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
|
||||||
|
|
||||||
$SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
|
$SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
|
||||||
|
|
@ -122,12 +122,12 @@ function Get-SnipeitLicense() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -157,7 +157,7 @@ function Get-SnipeitLicense() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ function Get-SnipeitLicenseSeat() {
|
||||||
begin {
|
begin {
|
||||||
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
|
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
|
||||||
|
|
||||||
$SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
|
$SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters -DefaultExcludeParameter 'url', 'apiKey', 'Debug', 'Verbose','RequestType'
|
||||||
|
|
||||||
$api = "/api/v1/licenses/$id/seats"
|
$api = "/api/v1/licenses/$id/seats"
|
||||||
|
|
||||||
|
|
@ -71,12 +71,12 @@ function Get-SnipeitLicenseSeat() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -106,7 +106,7 @@ function Get-SnipeitLicenseSeat() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,24 @@ A text string to search the Locations data
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific Location
|
A id of specific Location
|
||||||
|
|
||||||
|
.PARAMETER name
|
||||||
|
Optionally restrict Location results to this Location name.
|
||||||
|
|
||||||
|
.PARAMETER address
|
||||||
|
Optionally restrict Location results to this Location address.
|
||||||
|
|
||||||
|
.PARAMETER address2
|
||||||
|
Optionally restrict Location results to this Location address2.
|
||||||
|
|
||||||
|
.PARAMETER city
|
||||||
|
Optionally restrict Location results to this Location city.
|
||||||
|
|
||||||
|
.PARAMETER zip
|
||||||
|
Optionally restrict Location results to this Location zip.
|
||||||
|
|
||||||
|
.PARAMETER country
|
||||||
|
Optionally restrict Location results to this Location country.
|
||||||
|
|
||||||
.PARAMETER limit
|
.PARAMETER limit
|
||||||
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
||||||
|
|
||||||
|
|
@ -40,6 +58,24 @@ function Get-SnipeitLocation() {
|
||||||
[parameter(ParameterSetName='Get with ID')]
|
[parameter(ParameterSetName='Get with ID')]
|
||||||
[int]$id,
|
[int]$id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$name,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$address,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$address2,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$city,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$zip,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$country,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[ValidateSet("asc", "desc")]
|
[ValidateSet("asc", "desc")]
|
||||||
[string]$order = "desc",
|
[string]$order = "desc",
|
||||||
|
|
@ -80,12 +116,12 @@ function Get-SnipeitLocation() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -115,7 +151,7 @@ function Get-SnipeitLocation() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific Manufactuter
|
A id of specific Manufactuter
|
||||||
|
|
||||||
|
.PARAMETER name
|
||||||
|
Optionally restrict Manufacturer results to this name field
|
||||||
|
|
||||||
.PARAMETER limit
|
.PARAMETER limit
|
||||||
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
||||||
|
|
||||||
|
|
@ -41,6 +44,9 @@ function Get-SnipeitManufacturer() {
|
||||||
[parameter(ParameterSetName='Get with ID')]
|
[parameter(ParameterSetName='Get with ID')]
|
||||||
[int]$id,
|
[int]$id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$name,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[ValidateSet("asc", "desc")]
|
[ValidateSet("asc", "desc")]
|
||||||
[string]$order = "desc",
|
[string]$order = "desc",
|
||||||
|
|
@ -81,12 +87,12 @@ function Get-SnipeitManufacturer() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +122,7 @@ function Get-SnipeitManufacturer() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,12 +81,12 @@ function Get-SnipeitModel() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +116,7 @@ function Get-SnipeitModel() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ A text string to search the Status Labels data
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific Status Label
|
A id of specific Status Label
|
||||||
|
|
||||||
|
.PARAMETER name
|
||||||
|
Optionally restrict Status Label results to this name field
|
||||||
|
|
||||||
.PARAMETER limit
|
.PARAMETER limit
|
||||||
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
||||||
|
|
||||||
|
|
@ -40,6 +43,9 @@ function Get-SnipeitStatus() {
|
||||||
[parameter(ParameterSetName='Get with ID')]
|
[parameter(ParameterSetName='Get with ID')]
|
||||||
[int]$id,
|
[int]$id,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$name,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[ValidateSet("asc", "desc")]
|
[ValidateSet("asc", "desc")]
|
||||||
[string]$order = "desc",
|
[string]$order = "desc",
|
||||||
|
|
@ -80,12 +86,12 @@ function Get-SnipeitStatus() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -115,7 +121,7 @@ function Get-SnipeitStatus() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,33 @@ A text string to search the Supliers data
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific Suplier
|
A id of specific Suplier
|
||||||
|
|
||||||
|
.PARAMETER name
|
||||||
|
Optionally restrict Supplier results to this Supplier name.
|
||||||
|
|
||||||
|
.PARAMETER address
|
||||||
|
Optionally restrict Supplier results to this Supplier address.
|
||||||
|
|
||||||
|
.PARAMETER address2
|
||||||
|
Optionally restrict Supplier results to this Supplier address2.
|
||||||
|
|
||||||
|
.PARAMETER city
|
||||||
|
Optionally restrict Supplier results to this Supplier city.
|
||||||
|
|
||||||
|
.PARAMETER zip
|
||||||
|
Optionally restrict Supplier results to this Supplier zip.
|
||||||
|
|
||||||
|
.PARAMETER country
|
||||||
|
Optionally restrict Supplier results to this Supplier country.
|
||||||
|
|
||||||
|
.PARAMETER fax
|
||||||
|
Optionally restrict Supplier results to this Supplier fax number.
|
||||||
|
|
||||||
|
.PARAMETER email
|
||||||
|
Optionally restrict Supplier results to this Supplier email address.
|
||||||
|
|
||||||
|
.PARAMETER notes
|
||||||
|
Optionally restrict Supplier results to this Supplier notes field.
|
||||||
|
|
||||||
.PARAMETER limit
|
.PARAMETER limit
|
||||||
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
||||||
|
|
||||||
|
|
@ -43,6 +70,33 @@ function Get-SnipeitSupplier() {
|
||||||
[ValidateSet("asc", "desc")]
|
[ValidateSet("asc", "desc")]
|
||||||
[string]$order = "desc",
|
[string]$order = "desc",
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$name,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$address,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$address2,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$city,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$zip,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$country,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$fax,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$email,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$notes,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[int]$limit = 50,
|
[int]$limit = 50,
|
||||||
|
|
||||||
|
|
@ -80,12 +134,12 @@ function Get-SnipeitSupplier() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -114,7 +168,7 @@ function Get-SnipeitSupplier() {
|
||||||
}
|
}
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,56 @@ A text string to search the User data
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific User
|
A id of specific User
|
||||||
|
|
||||||
|
.PARAMETER accessory_id
|
||||||
|
Get users a specific accessory id has been checked out to
|
||||||
|
|
||||||
.PARAMETER username
|
.PARAMETER username
|
||||||
Search string for username field
|
Optionally restrict User results to this username field
|
||||||
|
|
||||||
.PARAMETER email
|
.PARAMETER email
|
||||||
Search string for email field
|
Optionally restrict User results to this email field
|
||||||
|
|
||||||
|
.PARAMETER employee_num
|
||||||
|
Optionally restrict User results to this employee_num field
|
||||||
|
|
||||||
|
.PARAMETER state
|
||||||
|
Optionally restrict User results to this state field
|
||||||
|
|
||||||
|
.PARAMETER country
|
||||||
|
Optionally restrict User results to this country field
|
||||||
|
|
||||||
|
.PARAMETER zip
|
||||||
|
Optionally restrict User results to this zip field
|
||||||
|
|
||||||
|
.PARAMETER company_id
|
||||||
|
Optionally restrict User results to this company_id field
|
||||||
|
|
||||||
|
.PARAMETER location_id
|
||||||
|
Optionally restrict User results to this location_id field
|
||||||
|
|
||||||
|
.PARAMETER department_id
|
||||||
|
Optionally restrict User results to this department_id field
|
||||||
|
|
||||||
|
.PARAMETER deleted
|
||||||
|
Optionally restrict User results to deleted users only
|
||||||
|
|
||||||
|
.PARAMETER ldap_import
|
||||||
|
Optionally restrict User results to those with specified ldap_import value
|
||||||
|
|
||||||
|
.PARAMETER remote
|
||||||
|
Optionally restrict User results to those with specified remote worker value
|
||||||
|
|
||||||
|
.PARAMETER assets_count
|
||||||
|
Optionally restrict User results to those with the specified assets count
|
||||||
|
|
||||||
|
.PARAMETER licenses_count
|
||||||
|
Optionally restrict User results to those with the specified licenses count
|
||||||
|
|
||||||
|
.PARAMETER accessories_count
|
||||||
|
Optionally restrict User results to those with the specified accessories count
|
||||||
|
|
||||||
|
.PARAMETER consumables_count
|
||||||
|
Optionally restrict User results to those with the specified consumables count
|
||||||
|
|
||||||
.PARAMETER limit
|
.PARAMETER limit
|
||||||
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
||||||
|
|
@ -75,7 +120,40 @@ function Get-SnipeitUser() {
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[string]$email,
|
[string]$email,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$employee_num,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$state,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$zip,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[string]$country,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[Nullable[bool]]$deleted,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[Nullable[bool]]$ldap_import,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[Nullable[bool]]$remote,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[int]$assets_count,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[int]$licenses_count,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[int]$accessories_count,
|
||||||
|
|
||||||
|
[parameter(ParameterSetName='Search')]
|
||||||
|
[int]$consumables_count,
|
||||||
|
|
||||||
[parameter(ParameterSetName='Search')]
|
[parameter(ParameterSetName='Search')]
|
||||||
[ValidateSet("asc", "desc")]
|
[ValidateSet("asc", "desc")]
|
||||||
[string]$order = "desc",
|
[string]$order = "desc",
|
||||||
|
|
@ -113,12 +191,12 @@ function Get-SnipeitUser() {
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -147,7 +225,7 @@ function Get-SnipeitUser() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,12 +130,12 @@ function New-SnipeitAccessory() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -150,7 +150,7 @@ function New-SnipeitAccessory() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,10 @@ Optional Purchase cost of the Asset
|
||||||
.PARAMETER purchase_date
|
.PARAMETER purchase_date
|
||||||
Optional Purchase cost of the Asset
|
Optional Purchase cost of the Asset
|
||||||
|
|
||||||
|
.PARAMETER supplier_id
|
||||||
|
Optional Supplier id of the Asset
|
||||||
|
|
||||||
|
|
||||||
.PARAMETER rtd_location_id
|
.PARAMETER rtd_location_id
|
||||||
Optional Default location id for the asset
|
Optional Default location id for the asset
|
||||||
|
|
||||||
|
|
@ -176,12 +180,12 @@ function New-SnipeitAsset() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -197,7 +201,7 @@ function New-SnipeitAsset() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,12 +96,12 @@ function New-SnipeitAssetMaintenance() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -117,7 +117,7 @@ function New-SnipeitAssetMaintenance() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ Long description
|
||||||
.PARAMETER Tag
|
.PARAMETER Tag
|
||||||
The asset tag of the asset you wish to audit
|
The asset tag of the asset you wish to audit
|
||||||
|
|
||||||
|
.PARAMETER next_audit_date
|
||||||
|
Due date for the asset's next audit
|
||||||
|
|
||||||
.PARAMETER Location_id
|
.PARAMETER Location_id
|
||||||
ID of the location you want to associate with the audit
|
ID of the location you want to associate with the audit
|
||||||
|
|
||||||
|
|
@ -28,6 +31,9 @@ function New-SnipeitAudit() {
|
||||||
|
|
||||||
[int]$location_id,
|
[int]$location_id,
|
||||||
|
|
||||||
|
[parameter(mandatory = $false)]
|
||||||
|
[datetime]$next_audit_date,
|
||||||
|
|
||||||
[parameter(mandatory = $false)]
|
[parameter(mandatory = $false)]
|
||||||
[string]$url,
|
[string]$url,
|
||||||
|
|
||||||
|
|
@ -45,6 +51,10 @@ function New-SnipeitAudit() {
|
||||||
if ($PSBoundParameters.ContainsKey('tag')) {
|
if ($PSBoundParameters.ContainsKey('tag')) {
|
||||||
$Values += @{"asset_tag" = $tag}
|
$Values += @{"asset_tag" = $tag}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($PSBoundParameters.ContainsKey('next_audit_date')) {
|
||||||
|
$Values += @{"next_audit_date" = ($next_audit_date).ToString("yyyy-MM-dd")}
|
||||||
|
}
|
||||||
|
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Api = "/api/v1/hardware/audit"
|
Api = "/api/v1/hardware/audit"
|
||||||
|
|
@ -52,12 +62,12 @@ function New-SnipeitAudit() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -73,7 +83,7 @@ function New-SnipeitAudit() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,12 +83,12 @@ function New-SnipeitCategory() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -102,7 +102,7 @@ function New-SnipeitCategory() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,12 @@ function New-SnipeitCompany() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -73,7 +73,7 @@ function New-SnipeitCompany() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,12 +91,12 @@ function New-SnipeitComponent() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -112,7 +112,7 @@ function New-SnipeitComponent() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,12 +129,12 @@ function New-SnipeitConsumable() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -150,7 +150,7 @@ function New-SnipeitConsumable() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,11 +88,11 @@ function New-SnipeitCustomField() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -107,7 +107,7 @@ function New-SnipeitCustomField() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,12 +71,12 @@ function New-SnipeitDepartment() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -92,7 +92,7 @@ function New-SnipeitDepartment() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,12 +146,12 @@ function New-SnipeitLicense() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -166,7 +166,7 @@ function New-SnipeitLicense() {
|
||||||
}
|
}
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,12 +104,12 @@ function New-SnipeitLocation() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -125,7 +125,7 @@ function New-SnipeitLocation() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,12 +59,12 @@ function New-SnipeitManufacturer() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -78,7 +78,7 @@ function New-SnipeitManufacturer() {
|
||||||
}
|
}
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ function New-SnipeitModel() {
|
||||||
|
|
||||||
[int]$eol,
|
[int]$eol,
|
||||||
|
|
||||||
[parameter(mandatory = $true)]
|
[parameter(mandatory = $false)]
|
||||||
[int]$fieldset_id,
|
[int]$fieldset_id,
|
||||||
|
|
||||||
[ValidateScript({Test-Path $_})]
|
[ValidateScript({Test-Path $_})]
|
||||||
|
|
@ -86,12 +86,12 @@ function New-SnipeitModel() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -107,7 +107,7 @@ function New-SnipeitModel() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,12 +107,12 @@ function New-SnipeitSupplier() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -128,7 +128,7 @@ function New-SnipeitSupplier() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,9 @@
|
||||||
.PARAMETER manager_id
|
.PARAMETER manager_id
|
||||||
ID number of manager
|
ID number of manager
|
||||||
|
|
||||||
|
.PARAMETER groups
|
||||||
|
ID numbers of groups
|
||||||
|
|
||||||
.PARAMETER employee_num
|
.PARAMETER employee_num
|
||||||
Employeenumber
|
Employeenumber
|
||||||
|
|
||||||
|
|
@ -103,6 +106,8 @@ function New-SnipeitUser() {
|
||||||
|
|
||||||
[int]$manager_id,
|
[int]$manager_id,
|
||||||
|
|
||||||
|
[int[]]$groups,
|
||||||
|
|
||||||
[string]$employee_num,
|
[string]$employee_num,
|
||||||
|
|
||||||
[bool]$ldap_import = $false,
|
[bool]$ldap_import = $false,
|
||||||
|
|
@ -131,12 +136,12 @@ function New-SnipeitUser() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +157,7 @@ function New-SnipeitUser() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,12 @@ function Remove-SnipeitAccessory () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ function Remove-SnipeitAccessory () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,12 +46,12 @@ function Remove-SnipeitAsset () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -66,7 +66,7 @@ function Remove-SnipeitAsset () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,12 @@ function Remove-SnipeitAssetMaintenance {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ function Remove-SnipeitAssetMaintenance {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,12 @@ function Remove-SnipeitCategory () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -64,7 +64,7 @@ function Remove-SnipeitCategory () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,12 @@ function Remove-SnipeitCompany () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -64,7 +64,7 @@ function Remove-SnipeitCompany () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,12 @@ function Remove-SnipeitComponent () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ function Remove-SnipeitComponent () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,12 +46,12 @@ function Remove-SnipeitConsumable () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -66,7 +66,7 @@ function Remove-SnipeitConsumable () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,12 +43,12 @@ function Remove-SnipeitCustomField () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -63,7 +63,7 @@ function Remove-SnipeitCustomField () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,12 @@ function Remove-SnipeitDepartment () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -64,7 +64,7 @@ function Remove-SnipeitDepartment () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,12 @@ function Remove-SnipeitLicense () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ function Remove-SnipeitLicense () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,12 @@ function Remove-SnipeitLocation () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ function Remove-SnipeitLocation () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,12 @@ function Remove-SnipeitManufacturer () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -66,7 +66,7 @@ function Remove-SnipeitManufacturer () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,12 @@ function Remove-SnipeitModel () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ function Remove-SnipeitModel () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,12 @@ function Remove-SnipeitSupplier () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ function Remove-SnipeitSupplier () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,12 @@ function Remove-SnipeitUser () {
|
||||||
Method = 'Delete'
|
Method = 'Delete'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -64,7 +64,7 @@ function Remove-SnipeitUser () {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,12 +48,12 @@ function Reset-SnipeitAccessoryOwner() {
|
||||||
Body = @{}
|
Body = @{}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -63,7 +63,7 @@ function Reset-SnipeitAccessoryOwner() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
.PARAMETER location_id
|
.PARAMETER location_id
|
||||||
Location id to change asset location to
|
Location id to change asset location to
|
||||||
|
|
||||||
.PARAMETER notes
|
.PARAMETER note
|
||||||
Notes about checkin
|
Notes about checkin
|
||||||
|
|
||||||
.PARAMETER url
|
.PARAMETER url
|
||||||
|
|
@ -37,7 +37,7 @@ function Reset-SnipeitAssetOwner() {
|
||||||
|
|
||||||
[int]$location_id,
|
[int]$location_id,
|
||||||
|
|
||||||
[string]$notes,
|
[string]$note,
|
||||||
|
|
||||||
[parameter(mandatory = $false)]
|
[parameter(mandatory = $false)]
|
||||||
[string]$url,
|
[string]$url,
|
||||||
|
|
@ -49,7 +49,7 @@ function Reset-SnipeitAssetOwner() {
|
||||||
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
|
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
|
||||||
|
|
||||||
$Values = @{
|
$Values = @{
|
||||||
"notes" = $notes
|
"note" = $note
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('location_id')) { $Values.Add("location_id", $location_id) }
|
if ($PSBoundParameters.ContainsKey('location_id')) { $Values.Add("location_id", $location_id) }
|
||||||
|
|
@ -61,12 +61,12 @@ function Reset-SnipeitAssetOwner() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -76,7 +76,7 @@ function Reset-SnipeitAssetOwner() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,12 +132,12 @@ function Set-SnipeitAccessory() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +152,7 @@ function Set-SnipeitAccessory() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,12 +55,12 @@ function Set-SnipeitAccessoryOwner() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -75,7 +75,7 @@ function Set-SnipeitAccessoryOwner() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
ID of the Asset or array of IDs
|
ID of the Asset or array of IDs
|
||||||
|
|
||||||
|
.PARAMETER asset_tag
|
||||||
|
New tag for asset.
|
||||||
|
|
||||||
.PARAMETER Name
|
.PARAMETER Name
|
||||||
Asset name
|
Asset name
|
||||||
|
|
||||||
|
|
@ -41,6 +44,9 @@
|
||||||
.PARAMETER purchase_date
|
.PARAMETER purchase_date
|
||||||
Date of asset purchase
|
Date of asset purchase
|
||||||
|
|
||||||
|
.PARAMETER supplier_id
|
||||||
|
Supplier id of the Asset
|
||||||
|
|
||||||
.PARAMETER requestable
|
.PARAMETER requestable
|
||||||
Whether or not the asset can be requested by users with the permission to request assets
|
Whether or not the asset can be requested by users with the permission to request assets
|
||||||
|
|
||||||
|
|
@ -91,6 +97,9 @@ function Set-SnipeitAsset() {
|
||||||
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
|
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
|
||||||
[int[]]$id,
|
[int[]]$id,
|
||||||
|
|
||||||
|
[parameter(Mandatory=$false)]
|
||||||
|
[string]
|
||||||
|
$asset_tag,
|
||||||
|
|
||||||
[string]$name,
|
[string]$name,
|
||||||
|
|
||||||
|
|
@ -116,6 +125,9 @@ function Set-SnipeitAsset() {
|
||||||
|
|
||||||
[datetime]$purchase_date,
|
[datetime]$purchase_date,
|
||||||
|
|
||||||
|
[parameter(mandatory = $false)]
|
||||||
|
[int]$supplier_id,
|
||||||
|
|
||||||
[bool]$requestable,
|
[bool]$requestable,
|
||||||
|
|
||||||
[bool]$archived,
|
[bool]$archived,
|
||||||
|
|
@ -164,12 +176,12 @@ function Set-SnipeitAsset() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -184,7 +196,7 @@ function Set-SnipeitAsset() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,12 +99,12 @@ function Set-SnipeitAssetOwner() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -119,7 +119,7 @@ function Set-SnipeitAssetOwner() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,12 +92,12 @@ function Set-SnipeitCategory() {
|
||||||
Body = $values
|
Body = $values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -112,7 +112,7 @@ function Set-SnipeitCategory() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,12 +72,12 @@ function Set-SnipeitCompany() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -91,7 +91,7 @@ function Set-SnipeitCompany() {
|
||||||
}
|
}
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,12 +112,12 @@ function Set-SnipeitComponent() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -132,7 +132,7 @@ function Set-SnipeitComponent() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -152,12 +152,12 @@ function Set-SnipeitConsumable() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -172,7 +172,7 @@ function Set-SnipeitConsumable() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,12 +97,12 @@ function Set-SnipeitCustomField() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +116,7 @@ function Set-SnipeitCustomField() {
|
||||||
}
|
}
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,12 +88,12 @@ function Set-SnipeitDepartment() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -107,7 +107,7 @@ function Set-SnipeitDepartment() {
|
||||||
}
|
}
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,12 +161,12 @@ function Set-SnipeitLicense() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +180,7 @@ function Set-SnipeitLicense() {
|
||||||
}
|
}
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,12 +82,12 @@ function Set-SnipeitLicenseSeat() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -101,7 +101,7 @@ function Set-SnipeitLicenseSeat() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,12 +126,12 @@ function Set-SnipeitLocation() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -146,7 +146,7 @@ function Set-SnipeitLocation() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,12 +66,12 @@ function Set-SnipeitManufacturer() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -86,7 +86,7 @@ function Set-SnipeitManufacturer() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,12 +95,12 @@ function Set-SnipeitModel() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -115,7 +115,7 @@ function Set-SnipeitModel() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,12 +77,12 @@ function Set-SnipeitStatus() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -96,7 +96,7 @@ function Set-SnipeitStatus() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,12 +122,12 @@ function Set-SnipeitSupplier() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -142,7 +142,7 @@ function Set-SnipeitSupplier() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,9 @@
|
||||||
.PARAMETER manager_id
|
.PARAMETER manager_id
|
||||||
ID number of manager
|
ID number of manager
|
||||||
|
|
||||||
|
.PARAMETER groups
|
||||||
|
ID numbers of groups
|
||||||
|
|
||||||
.PARAMETER employee_num
|
.PARAMETER employee_num
|
||||||
Employeenumber
|
Employeenumber
|
||||||
|
|
||||||
|
|
@ -110,12 +113,16 @@ function Set-SnipeitUser() {
|
||||||
|
|
||||||
[Nullable[System.Int32]]$manager_id,
|
[Nullable[System.Int32]]$manager_id,
|
||||||
|
|
||||||
|
[int[]]$groups,
|
||||||
|
|
||||||
[string]$employee_num,
|
[string]$employee_num,
|
||||||
|
|
||||||
[bool]$activated,
|
[bool]$activated,
|
||||||
|
|
||||||
[string]$notes,
|
[string]$notes,
|
||||||
|
|
||||||
|
[bool]$ldap_import,
|
||||||
|
|
||||||
[ValidateScript({Test-Path $_})]
|
[ValidateScript({Test-Path $_})]
|
||||||
[string]$image,
|
[string]$image,
|
||||||
|
|
||||||
|
|
@ -149,12 +156,12 @@ function Set-SnipeitUser() {
|
||||||
Body = $Values
|
Body = $Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-apiKey parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
Set-SnipeitPSLegacyApiKey -apiKey $apikey
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSBoundParameters.ContainsKey('url')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url) {
|
||||||
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
Write-Warning "-url parameter is deprecated, please use Connect-SnipeitPS instead."
|
||||||
Set-SnipeitPSLegacyUrl -url $url
|
Set-SnipeitPSLegacyUrl -url $url
|
||||||
}
|
}
|
||||||
|
|
@ -169,7 +176,7 @@ function Set-SnipeitUser() {
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# reset legacy sessions
|
# reset legacy sessions
|
||||||
if ($PSBoundParameters.ContainsKey('url') -or $PSBoundParameters.ContainsKey('apiKey')) {
|
if ($PSBoundParameters.ContainsKey('url') -and '' -ne [string]$url -or $PSBoundParameters.ContainsKey('apiKey') -and '' -ne [string]$apiKey) {
|
||||||
Reset-SnipeitPSLegacyApi
|
Reset-SnipeitPSLegacyApi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
@ -29,7 +29,7 @@ Connect-SnipeitPS -siteCred <PSCredential> [<CommonParameters>]
|
||||||
|
|
||||||
## DESCRIPTION
|
## DESCRIPTION
|
||||||
Sets apikey and url to connect Snipe-It system.
|
Sets apikey and url to connect Snipe-It system.
|
||||||
Based on Set-SnipeitInfo command, what is now just combatipility wrapper
|
Based on Set-SnipeitInfo command, what is now just compatibility wrapper
|
||||||
and calls Connect-SnipeitPS
|
and calls Connect-SnipeitPS
|
||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
@ -298,7 +298,7 @@ Accept wildcard characters: False
|
||||||
```
|
```
|
||||||
|
|
||||||
### -supplier_id
|
### -supplier_id
|
||||||
{{ Fill supplier_id Description }}
|
Optional Supplier id of the Asset
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
Type: Int32
|
Type: Int32
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
@ -13,8 +13,8 @@ Add a new Audit to Snipe-it asset system
|
||||||
## SYNTAX
|
## SYNTAX
|
||||||
|
|
||||||
```
|
```
|
||||||
New-SnipeitAudit [-tag] <String> [[-location_id] <Int32>] [[-url] <String>] [[-apiKey] <String>] [-WhatIf]
|
New-SnipeitAudit [-tag] <String> [[-location_id] <Int32>] [[-next_audit_date] <DateTime>] [[-url] <String>]
|
||||||
[-Confirm] [<CommonParameters>]
|
[[-apiKey] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||||
```
|
```
|
||||||
|
|
||||||
## DESCRIPTION
|
## DESCRIPTION
|
||||||
|
|
@ -38,7 +38,7 @@ Parameter Sets: (All)
|
||||||
Aliases:
|
Aliases:
|
||||||
|
|
||||||
Required: False
|
Required: False
|
||||||
Position: 4
|
Position: 5
|
||||||
Default value: None
|
Default value: None
|
||||||
Accept pipeline input: False
|
Accept pipeline input: False
|
||||||
Accept wildcard characters: False
|
Accept wildcard characters: False
|
||||||
|
|
@ -59,6 +59,21 @@ Accept pipeline input: False
|
||||||
Accept wildcard characters: False
|
Accept wildcard characters: False
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### -next_audit_date
|
||||||
|
Due date for the asset's next audit
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
Type: DateTime
|
||||||
|
Parameter Sets: (All)
|
||||||
|
Aliases:
|
||||||
|
|
||||||
|
Required: False
|
||||||
|
Position: 3
|
||||||
|
Default value: None
|
||||||
|
Accept pipeline input: False
|
||||||
|
Accept wildcard characters: False
|
||||||
|
```
|
||||||
|
|
||||||
### -tag
|
### -tag
|
||||||
The asset tag of the asset you wish to audit
|
The asset tag of the asset you wish to audit
|
||||||
|
|
||||||
|
|
@ -83,7 +98,7 @@ Parameter Sets: (All)
|
||||||
Aliases:
|
Aliases:
|
||||||
|
|
||||||
Required: False
|
Required: False
|
||||||
Position: 3
|
Position: 4
|
||||||
Default value: None
|
Default value: None
|
||||||
Accept pipeline input: False
|
Accept pipeline input: False
|
||||||
Accept wildcard characters: False
|
Accept wildcard characters: False
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
external help file: SnipeitPS-help.xml
|
external help file: SnipeitPS-help.xml
|
||||||
Module Name: snipeitps
|
Module Name: SnipeitPS
|
||||||
online version:
|
online version:
|
||||||
schema: 2.0.0
|
schema: 2.0.0
|
||||||
---
|
---
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue