Make url and apikey optional

This commit is contained in:
Petri Asikainen 2021-07-31 22:25:13 +03:00
parent cde16b1983
commit 7b2cffda28
71 changed files with 225 additions and 192 deletions

View file

@ -79,10 +79,10 @@ function Get-SnipeitAccessory() {
[parameter(ParameterSetName='Accessories checked out to user id')] [parameter(ParameterSetName='Accessories checked out to user id')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name

View file

@ -27,10 +27,10 @@ function Get-SnipeitAccessoryOwner()
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[int]$id, [int]$id,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -71,10 +71,10 @@ function Get-SnipeitActivity() {
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -199,10 +199,10 @@ function Get-SnipeitAsset() {
[parameter(ParameterSetName='Assets with component id')] [parameter(ParameterSetName='Assets with component id')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -55,10 +55,10 @@ function Get-SnipeitAssetMaintenance() {
[int]$offset, [int]$offset,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -54,10 +54,10 @@ function Get-SnipeitCategory()
[parameter(ParameterSetName='Search')] [parameter(ParameterSetName='Search')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name

View file

@ -55,10 +55,10 @@ function Get-SnipeitCompany()
[parameter(ParameterSetName='Search')] [parameter(ParameterSetName='Search')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory=$true)] [parameter(mandatory=$false)]
[string]$url, [string]$url,
[parameter(mandatory=$true)] [parameter(mandatory=$false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -71,10 +71,10 @@ function Get-SnipeitComponent() {
[parameter(ParameterSetName='Search')] [parameter(ParameterSetName='Search')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -96,10 +96,10 @@ function Get-SnipeitConsumable() {
[parameter(ParameterSetName='Search')] [parameter(ParameterSetName='Search')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )
begin { begin {

View file

@ -21,10 +21,10 @@ function Get-SnipeitCustomField()
Param( Param(
[int]$id, [int]$id,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -61,10 +61,10 @@ function Get-SnipeitDepartment()
[ValidateSet('id', 'name', 'image', 'users_count', 'created_at')] [ValidateSet('id', 'name', 'image', 'users_count', 'created_at')]
[string]$sort = "created_at", [string]$sort = "created_at",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -23,10 +23,10 @@ function Get-SnipeitFieldset() {
Param( Param(
[int]$id, [int]$id,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -98,10 +98,10 @@ function Get-SnipeitLicense() {
[parameter(ParameterSetName='Search')] [parameter(ParameterSetName='Search')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -47,10 +47,10 @@ function Get-SnipeitLicenseSeat() {
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -54,10 +54,10 @@ function Get-SnipeitLocation()
[parameter(ParameterSetName='Search')] [parameter(ParameterSetName='Search')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -55,10 +55,10 @@ function Get-SnipeitManufacturer()
[parameter(ParameterSetName='Search')] [parameter(ParameterSetName='Search')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -54,10 +54,10 @@ function Get-SnipeitModel()
[parameter(ParameterSetName='Search')] [parameter(ParameterSetName='Search')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -54,10 +54,10 @@ function Get-SnipeitStatus()
[parameter(ParameterSetName='Search')] [parameter(ParameterSetName='Search')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -53,10 +53,10 @@ function Get-SnipeitSupplier()
[parameter(ParameterSetName='Search')] [parameter(ParameterSetName='Search')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -90,10 +90,10 @@ function Get-SnipeitUser() {
[parameter(ParameterSetName='Get users a specific accessory id has been checked out to')] [parameter(ParameterSetName='Get users a specific accessory id has been checked out to')]
[switch]$all = $false, [switch]$all = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -109,10 +109,10 @@ function New-SnipeitAccessory() {
[ValidateScript({Test-Path $_})] [ValidateScript({Test-Path $_})]
[string]$image, [string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -135,10 +135,10 @@ function New-SnipeitAsset()
[ValidateSet("location","asset","user")] [ValidateSet("location","asset","user")]
[string] $checkout_to_type = "user", [string] $checkout_to_type = "user",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey, [string]$apiKey,
[Alias('CustomValues')] [Alias('CustomValues')]

View file

@ -70,10 +70,10 @@ function New-SnipeitAssetMaintenance() {
[string]$notes, [string]$notes,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -29,10 +29,10 @@ function New-SnipeitAudit()
[int]$location_id, [int]$location_id,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -59,10 +59,10 @@ function New-SnipeitCategory()
[ValidateScript({Test-Path $_})] [ValidateScript({Test-Path $_})]
[string]$image, [string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -36,10 +36,10 @@ function New-SnipeitCompany()
[ValidateScript({Test-Path $_})] [ValidateScript({Test-Path $_})]
[string]$image, [string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -71,10 +71,10 @@ function New-SnipeitComponent() {
[ValidateScript({Test-Path $_})] [ValidateScript({Test-Path $_})]
[string]$image, [string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -110,10 +110,10 @@ function New-SnipeitConsumable()
[ValidateScript({Test-Path $_})] [ValidateScript({Test-Path $_})]
[string]$image, [string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -68,10 +68,10 @@ function New-SnipeitCustomField()
[string]$custom_format, [string]$custom_format,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -54,10 +54,10 @@ function New-SnipeitDepartment() {
[switch]$image_delete=$false, [switch]$image_delete=$false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -117,10 +117,10 @@ function New-SnipeitLicense() {
[datetime]$termination_date, [datetime]$termination_date,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -86,10 +86,10 @@ function New-SnipeitLocation() {
[switch]$image_delete=$false, [switch]$image_delete=$false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -40,10 +40,10 @@ function New-SnipeitManufacturer()
[switch]$image_delete=$false, [switch]$image_delete=$false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -60,10 +60,10 @@ function New-SnipeitModel()
[ValidateScript({Test-Path $_})] [ValidateScript({Test-Path $_})]
[string]$image, [string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -90,10 +90,10 @@ function New-SnipeitSupplier() {
[ValidateScript({Test-Path $_})] [ValidateScript({Test-Path $_})]
[string]$image, [string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -110,10 +110,10 @@ function New-SnipeitUser() {
[ValidateScript({Test-Path $_})] [ValidateScript({Test-Path $_})]
[string]$image, [string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -26,16 +26,19 @@ function Remove-SnipeitAccessory ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
[parameter(mandatory = $false)]
[string]$url,
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {
} }
process { process {
foreach($accessory_id in $id){ foreach($accessory_id in $id){
$Parameters = @{ $Parameters = @{

View file

@ -26,17 +26,20 @@ function Remove-SnipeitAsset ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
[parameter(mandatory = $false)]
[string]$url,
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
} }
process { process {
foreach($asset_id in $id){ foreach($asset_id in $id){
$Parameters = @{ $Parameters = @{

View file

@ -23,24 +23,21 @@ function Remove-SnipeitAssetMaintenance {
ConfirmImpact = "Low" ConfirmImpact = "Low"
)] )]
param ( param (
# Asset maintenance ID
[Parameter(Mandatory = $true,ValueFromPipelineByPropertyName)] [Parameter(Mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]] [int[]]
$id, $id,
# Snipeit URL [parameter(mandatory = $false)]
[Parameter(Mandatory = $true)] [string]$url,
[string]
$url,
# Snipeit ApiKey [parameter(mandatory = $false)]
[Parameter(Mandatory = $true)] [string]$apiKey
[string]
$apiKey
) )
begin { begin {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
} }
process { process {
foreach($maintenance_id in $id){ foreach($maintenance_id in $id){
$Parameters = @{ $Parameters = @{

View file

@ -26,12 +26,14 @@ function Remove-SnipeitCategory ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL, [parameter(mandatory = $false)]
[parameter(mandatory = $true)] [string]$url,
[string]$APIKey
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {

View file

@ -26,12 +26,14 @@ function Remove-SnipeitCompany ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL, [parameter(mandatory = $false)]
[parameter(mandatory = $true)] [string]$url,
[string]$APIKey
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {

View file

@ -26,16 +26,19 @@ function Remove-SnipeitComponent ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
[parameter(mandatory = $false)]
[string]$url,
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {
} }
process { process {
foreach($component_id in $id){ foreach($component_id in $id){
$Parameters = @{ $Parameters = @{

View file

@ -27,16 +27,19 @@ function Remove-SnipeitConsumable ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
[parameter(mandatory = $false)]
[string]$url,
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {
} }
process { process {
foreach($consumable_id in $id){ foreach($consumable_id in $id){
$Parameters = @{ $Parameters = @{

View file

@ -26,13 +26,14 @@ function Remove-SnipeitCustomField ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
[parameter(mandatory = $false)]
[string]$url,
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {
} }

View file

@ -26,12 +26,14 @@ function Remove-SnipeitDepartment ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL, [parameter(mandatory = $false)]
[parameter(mandatory = $true)] [string]$url,
[string]$APIKey
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {

View file

@ -26,16 +26,19 @@ function Remove-SnipeitLicense ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
[parameter(mandatory = $false)]
[string]$url,
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {
} }
process { process {
foreach($license_id in $id){ foreach($license_id in $id){
$Parameters = @{ $Parameters = @{

View file

@ -26,16 +26,19 @@ function Remove-SnipeitLocation ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
[parameter(mandatory = $false)]
[string]$url,
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {
} }
process { process {
foreach($location_id in $id){ foreach($location_id in $id){
$Parameters = @{ $Parameters = @{

View file

@ -26,16 +26,19 @@ function Remove-SnipeitManufacturer ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
[parameter(mandatory = $false)]
[string]$url,
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {
} }
process { process {
foreach($manufacturer_id in $id){ foreach($manufacturer_id in $id){
$Parameters = @{ $Parameters = @{

View file

@ -26,16 +26,19 @@ function Remove-SnipeitModel ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
[parameter(mandatory = $false)]
[string]$url,
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {
} }
process { process {
foreach($model_id in $id){ foreach($model_id in $id){
$Parameters = @{ $Parameters = @{

View file

@ -26,16 +26,19 @@ function Remove-SnipeitSupplier ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
[parameter(mandatory = $false)]
[string]$url,
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin { begin {
} }
process { process {
foreach($suppliers_id in $id){ foreach($suppliers_id in $id){
$Parameters = @{ $Parameters = @{

View file

@ -24,14 +24,16 @@ function Remove-SnipeitUser ()
)] )]
Param( Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int]$id, [int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
[parameter(mandatory = $false)]
[string]$url,
[parameter(mandatory = $false)]
[string]$apiKey
) )
begin{ begin{
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
} }

View file

@ -36,10 +36,10 @@ function Reset-SnipeitAccessoryOwner()
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[int]$assigned_pivot_id, [int]$assigned_pivot_id,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -41,10 +41,10 @@ function Reset-SnipeitAssetOwner() {
[string]$notes, [string]$notes,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -107,10 +107,10 @@ function Set-SnipeitAccessory() {
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -38,10 +38,10 @@ function Set-SnipeitAccessoryOwner()
[string] $note, [string] $note,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )
begin{ begin{

View file

@ -133,10 +133,10 @@ function Set-SnipeitAsset()
[switch]$image_delete=$false, [switch]$image_delete=$false,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey, [string]$apiKey,
[Alias('CustomValues')] [Alias('CustomValues')]

View file

@ -61,10 +61,10 @@ function Set-SnipeitAssetOwner()
[datetime]$checkout_at, [datetime]$checkout_at,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -71,10 +71,10 @@ function Set-SnipeitCategory()
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -54,10 +54,10 @@ function Set-SnipeitCompany()
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -90,10 +90,10 @@ function Set-SnipeitComponent()
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )
begin { begin {

View file

@ -129,10 +129,10 @@ function Set-SnipeitConsumable()
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -75,10 +75,10 @@ function Set-SnipeitCustomField()
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Put", [string]$RequestType = "Put",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )
begin { begin {

View file

@ -68,10 +68,10 @@ function Set-SnipeitDepartment() {
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -127,10 +127,10 @@ function Set-SnipeitLicense() {
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -64,10 +64,10 @@ function Set-SnipeitLicenseSeat()
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -105,10 +105,10 @@ function Set-SnipeitLocation() {
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -46,10 +46,10 @@ function Set-SnipeitManufacturer()
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -74,10 +74,10 @@ function Set-SnipeitModel() {
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -59,10 +59,10 @@ function Set-SnipeitStatus()
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -101,10 +101,10 @@ function Set-SnipeitSupplier() {
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )

View file

@ -124,10 +124,10 @@ function Set-SnipeitUser() {
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $false)]
[string]$apiKey [string]$apiKey
) )
begin{ begin{