From 3cf0baff41cb439d1682d5f2339b59d3ca100b38 Mon Sep 17 00:00:00 2001 From: Stephen Maunder Date: Mon, 29 Apr 2019 14:20:01 +0100 Subject: [PATCH 1/2] Changed from Get-Locations to Get-Snipeitlocation to fix build --- SnipeitPS/Public/Get-SnipeitLocation.ps1 | 51 ++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 SnipeitPS/Public/Get-SnipeitLocation.ps1 diff --git a/SnipeitPS/Public/Get-SnipeitLocation.ps1 b/SnipeitPS/Public/Get-SnipeitLocation.ps1 new file mode 100644 index 0000000..0030a89 --- /dev/null +++ b/SnipeitPS/Public/Get-SnipeitLocation.ps1 @@ -0,0 +1,51 @@ +<# +.SYNOPSIS +# Gets a list of Snipe-it Locations + +.PARAMETER url +URL of Snipeit system, can be set using Set-Info command + +.PARAMETER apiKey +Users API Key for Snipeit, can be set using Set-Info command + +.EXAMPLE +Get-Location -url "https://assets.example.com" -token "token..." + +.EXAMPLE +Get-Location -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Location1" } + +#> + +function Get-SnipeitLocation() +{ + Param( + [string]$search, + + [ValidateSet("asc", "desc")] + [string]$order = "desc", + + [int]$limit = 50, + + [int]$offset, + + [parameter(mandatory = $true)] + [string]$url, + + [parameter(mandatory = $true)] + [string]$apiKey + ) + + $SearchParameter = . Get-ParameterValue + + $Parameters = @{ + Uri = "$url/api/v1/locations" + Method = 'Get' + Token = $apiKey + GetParameters = $SearchParameter + } + + $result = Invoke-SnipeitMethod @Parameters + + $result +} + From 55268bfe88613519211862dda7ffa2f602b13139 Mon Sep 17 00:00:00 2001 From: Stephen Maunder Date: Mon, 29 Apr 2019 14:20:13 +0100 Subject: [PATCH 2/2] Update psd1 --- SnipeitPS/SnipeItPS.psd1 | Bin 9582 -> 9596 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/SnipeitPS/SnipeItPS.psd1 b/SnipeitPS/SnipeItPS.psd1 index 2d05b606d900e75a425bf9abdac880b483bdfee5..780aa3c855eff24d20b6fc42db8090c49bb5cdd0 100644 GIT binary patch delta 26 gcmaFo^~Y<2k_c}wLmopWLjgl7kSy7(DB>#!0C>j-lmGw# delta 28 icmez4_0DU9lE~ykVp@|Ah;U5)B4z}lH_s7yAOHZl0So#7