mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-14 02:12:29 +00:00
Extra checks
This commit is contained in:
parent
4515fe0834
commit
2c1454b673
7 changed files with 16 additions and 9 deletions
|
|
@ -68,7 +68,10 @@ function New-Asset()
|
||||||
"model_id" = $model_id
|
"model_id" = $model_id
|
||||||
}
|
}
|
||||||
|
|
||||||
$Values += $customfields
|
if ($customfields)
|
||||||
|
{
|
||||||
|
$Values += $customfields
|
||||||
|
}
|
||||||
|
|
||||||
$Body = $Values | ConvertTo-Json;
|
$Body = $Values | ConvertTo-Json;
|
||||||
|
|
||||||
|
|
@ -79,7 +82,7 @@ function New-Asset()
|
||||||
Token = $apiKey
|
Token = $apiKey
|
||||||
}
|
}
|
||||||
|
|
||||||
If ($PSCmdlet.ShouldProcess())
|
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
|
||||||
{
|
{
|
||||||
$result = Invoke-Method @Parameters
|
$result = Invoke-Method @Parameters
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ function New-Component()
|
||||||
Token = $apiKey
|
Token = $apiKey
|
||||||
}
|
}
|
||||||
|
|
||||||
If ($PSCmdlet.ShouldProcess())
|
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
|
||||||
{
|
{
|
||||||
$result = Invoke-Method @Parameters
|
$result = Invoke-Method @Parameters
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ function New-Manufacturer()
|
||||||
Token = $apiKey
|
Token = $apiKey
|
||||||
}
|
}
|
||||||
|
|
||||||
If ($PSCmdlet.ShouldProcess())
|
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
|
||||||
{
|
{
|
||||||
$result = Invoke-Method @Parameters
|
$result = Invoke-Method @Parameters
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ function New-Model()
|
||||||
Token = $apiKey
|
Token = $apiKey
|
||||||
}
|
}
|
||||||
|
|
||||||
If ($PSCmdlet.ShouldProcess())
|
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
|
||||||
{
|
{
|
||||||
$result = Invoke-Method @Parameters
|
$result = Invoke-Method @Parameters
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,11 @@ function Set-Asset()
|
||||||
"model_id" = $model_id
|
"model_id" = $model_id
|
||||||
}
|
}
|
||||||
|
|
||||||
$Values += $customfields
|
if ($customfields)
|
||||||
|
{
|
||||||
|
$Values += $customfields
|
||||||
|
}
|
||||||
|
|
||||||
$Body = $Values | ConvertTo-Json;
|
$Body = $Values | ConvertTo-Json;
|
||||||
|
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
|
|
@ -78,7 +82,7 @@ function Set-Asset()
|
||||||
Token = $apiKey
|
Token = $apiKey
|
||||||
}
|
}
|
||||||
|
|
||||||
If ($PSCmdlet.ShouldProcess())
|
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
|
||||||
{
|
{
|
||||||
$result = Invoke-Method @Parameters
|
$result = Invoke-Method @Parameters
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ function Set-AssetOwner()
|
||||||
Token = $apiKey
|
Token = $apiKey
|
||||||
}
|
}
|
||||||
|
|
||||||
If ($PSCmdlet.ShouldProcess())
|
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
|
||||||
{
|
{
|
||||||
$result = Invoke-Method @Parameters
|
$result = Invoke-Method @Parameters
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ function Set-Component()
|
||||||
Token = $apiKey
|
Token = $apiKey
|
||||||
}
|
}
|
||||||
|
|
||||||
If ($PSCmdlet.ShouldProcess())
|
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
|
||||||
{
|
{
|
||||||
$result = Invoke-Method @Parameters
|
$result = Invoke-Method @Parameters
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue