diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cf8a8a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +BuildOutput \ No newline at end of file diff --git a/Build/build.ps1 b/Build/build.ps1 new file mode 100644 index 0000000..76757ad --- /dev/null +++ b/Build/build.ps1 @@ -0,0 +1,22 @@ +param( + [string[]] + $Task = 'Default' +) + +Get-PackageProvider -Name NuGet -ForceBootstrap > $null + +$ModuleRoot = (Split-Path $PSScriptRoot -Parent) + +Install-Module Psake,Pester -Scope CurrentUser -Force + + +Import-Module -Name Psake, (Join-Path $ModuleRoot KaceSma.psd1) + +$invokePsakeSplat = @{ + TaskList = $Task + NoLogo = $true + BuildFile = "$PSScriptRoot/Psake.ps1" +} +Invoke-Psake @invokePsakeSplat + +exit [int](-not $Psake.Build_Success) diff --git a/Build/psake.ps1 b/Build/psake.ps1 new file mode 100644 index 0000000..df276fe --- /dev/null +++ b/Build/psake.ps1 @@ -0,0 +1,31 @@ +Task 'Default' -Depends 'Pester' + +Task 'Init' { + $ModuleRoot = (Split-Path $PSScriptRoot -Parent) + + Import-Module -Name Psake, (Join-Path $ModuleRoot KaceSma.psd1) + +} + + +task 'Pester' -depends 'Init' { + $Timestamp = Get-Date -Format "yyyyMMdd-hhmmss" + $PSVersion = $PSVersionTable.PSVersion.Major + $ModuleRoot = (Split-Path $PSScriptRoot -Parent) + + $TestFile = "PSv${PSVersion}_${TimeStamp}_KaceSMA.TestResults.xml" + + $PesterParams = @{ + Path = (Join-Path (Split-Path $PSScriptRoot -Parent) 'tests') + PassThru = $true + OutputFormat = 'NUnitXml' + OutputFile = (Join-Path $ModuleRoot $TestFile) + Show = "Header", "Failed", "Summary" + } + + $TestResults = Invoke-Pester @PesterParams + + if ($TestResults.FailedCount -gt 0) { + Write-Error "Failed $($TestResults.FailedCount) tests; build failed!" + } +} \ No newline at end of file diff --git a/KaceSMA.psd1 b/KaceSMA.psd1 index cae46bb..7ba64f9 100644 Binary files a/KaceSMA.psd1 and b/KaceSMA.psd1 differ diff --git a/README.md b/README.md index f71963a..25c18b6 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,46 @@ # KaceSMA -[![](https://img.shields.io/powershellgallery/v/KaceSMA.svg?logo=powershell&colorA=1C8FDB&logoColor=ffffff&colorB=145C8B)](https://www.powershellgallery.com/packages/KaceSMA) -![](https://img.shields.io/powershellgallery/dt/KaceSMA.svg?logo=powershell&colorA=1C8FDB&logoColor=ffffff&colorB=145C8B) -[![GitHub issues](https://img.shields.io/github/issues/ArtisanByteCrafter/KaceSMA.svg?style=flat&colorA=1C8FDB)](https://github.com/ArtisanByteCrafter/KaceSMA/issues) ---- -A module for interacting with a Quest Kace Systems Management Appliance via Powershell. +[![Build Status](https://artisanbytecrafter.visualstudio.com/KaceSMA/_apis/build/status/ArtisanByteCrafter.KaceSMA?branchName=WIP-v2.0)](https://artisanbytecrafter.visualstudio.com/KaceSMA/_build/latest?definitionId=3&branchName=WIP-v2.0) [![](https://img.shields.io/powershellgallery/v/KaceSMA.svg?logo=powershell&colorA=1C8FDB&logoColor=ffffff&colorB=145C8B)](https://www.powershellgallery.com/packages/KaceSMA) + ![](https://img.shields.io/powershellgallery/dt/KaceSMA.svg?logo=powershell&colorA=1C8FDB&logoColor=ffffff&colorB=145C8B) -This module utilizes the Kace SMA API via Powershell and returns PS Objects that can be used in innumerable automation tasks. -This module is [available on the Powershell Gallery](https://www.powershellgallery.com/packages/KaceSMA/) -To Install: ---- +A Powershell module for administering and interacting with a Quest Systems Management Appliance (SMA) via it's API interface. + + + +### To Install + ````powershell Install-Module KaceSMA ```` -Questions or comments? ---- -Join the community Slack channel (#API) at https://kacecommunity.slack.com/ -Wiki ---- -* [Home](https://github.com/ArtisanByteCrafter/KaceSMA/wiki) -* [Frequently Asked Questions](https://github.com/ArtisanByteCrafter/KaceSMA/wiki/FAQ) +### Quickstart +- Import the module +- Authenticate to the appliance +- Perform a request + +```powershell +PS> Import-Module KaceSma +PS> Connect-SmaServer -Server 'https://kace.example.com' -Org 'Default' -Credential (Get-Credential) +PS> Get-SmaServiceDeskTicket -Id 1 + +title : I want to reset my password +created : 2019-06-13 09:01:13 +modified : 2019-06-13 09:31:02 +id : 1 +hd_queue_id : 10 +sla_dates : {} + +``` + +## FAQ + +[Visit the FAQ on the wiki](https://github.com/ArtisanByteCrafter/KaceSMA/wiki/FAQ) + +## Questions or comments? + +--- +Join the community [Slack channel]((https://kacecommunity.slack.com/)) (`#Api`) \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..48d7216 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,24 @@ +pool: + vmImage: windows-latest + +steps: +- task: PowerShell@2 + displayName: 'Pester Tests - Windows Powershell' + inputs: + filePath: '.\Build\build.ps1' + failOnStderr: true + +- task: PowerShell@2 + displayName: 'Pester Tests - Powershell Core' + inputs: + filePath: './Build/build.ps1' + failOnStderr: true + pwsh: true + +- task: PublishTestResults@2 + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: '**/*.TestResults.xml' + mergeTestResults: true + failTaskOnFailedTests: true + testRunTitle: 'Test Run' diff --git a/docs/Connect-SmaServer.md b/docs/Connect-SmaServer.md new file mode 100644 index 0000000..11cb0f0 --- /dev/null +++ b/docs/Connect-SmaServer.md @@ -0,0 +1,93 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Connect-SmaServer.md +schema: 2.0.0 +--- + +# Connect-SmaServer + +## SYNOPSIS + +## SYNTAX + +``` +Connect-SmaServer [-Server] <String> [-Org] <String> [-Credential] <PSCredential> [<CommonParameters>] +``` + +## DESCRIPTION +Connect to a SMA server. This command generates an access token to be used during the same session. This token has an expiration of 1 hour, after which you must authenticate again. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Connect-SmaServer -Server 'https://kace.example.com' -Org 'Default' -Credential (Get-Credential) + +Server Org Status Protocol User +------ ---- ------ -------- ---- +kace.example.com Default Connected HTTPS my_user +``` + +Connects to the default org of a Kace SMA Server. + +## PARAMETERS + +### -Credential +The credentials of the user authenticating to the SMA Server + +```yaml +Type: PSCredential +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Org +The SMA org to connect to. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Server +The FQDN of the appliance. Must begin with `https://` + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaAgentlessInventory.md b/docs/Get-SmaAgentlessInventory.md new file mode 100644 index 0000000..6b24a06 --- /dev/null +++ b/docs/Get-SmaAgentlessInventory.md @@ -0,0 +1,111 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaAgentlessInventory.md +schema: 2.0.0 +--- + +# Get-SmaAgentlessInventory + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaAgentlessInventory [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about the SMA agentless inventory, or a specific node. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaAgentlessInventory +``` + +Retrieves information about all agentless inventory nodes + +### EXAMPLE 2 +``` +Get-SmaAgentlessInventory -NodeID 1234 +``` + +Retrieves node information about an agentless node with with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the node to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: NodesId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaAsset.md b/docs/Get-SmaAsset.md new file mode 100644 index 0000000..41f6f1b --- /dev/null +++ b/docs/Get-SmaAsset.md @@ -0,0 +1,134 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaAsset.md +schema: 2.0.0 +--- + +# Get-SmaAsset + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaAsset [-Id <Int32>] [-AsBarcodes] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] + [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about an SMA asset. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaAsset +``` + +Retrieves information for all SMA assets. + +### EXAMPLE 2 +``` +Get-SmaAsset -AssetID 5678 +``` + +Retrieves information about an asset with ID 5678. + +### EXAMPLE 3 +``` +Get-SmaAsset -AssetID 5678 -AsBarcodes +``` + +Retrieves barcode information about an asset with ID 5678. + +## PARAMETERS + +### -AsBarcodes +Will return all barcodes associated with the requested assets. Can be used either with `-AssetID` parameter or with all assets. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the asset to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: AssetId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaAssetType.md b/docs/Get-SmaAssetType.md new file mode 100644 index 0000000..d2209f8 --- /dev/null +++ b/docs/Get-SmaAssetType.md @@ -0,0 +1,89 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaAssetType.md +schema: 2.0.0 +--- + +# Get-SmaAssetType + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaAssetType [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about an SMA asset type. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaAssetType +``` + +Retrieves information about all asset types within an org. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaBarcodeAsset.md b/docs/Get-SmaBarcodeAsset.md new file mode 100644 index 0000000..ea6597d --- /dev/null +++ b/docs/Get-SmaBarcodeAsset.md @@ -0,0 +1,111 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaBarcodeAsset.md +schema: 2.0.0 +--- + +# Get-SmaBarcodeAsset + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaBarcodeAsset [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about an SMA barcode. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaBarcodeAsset +``` + +Retrieves information about all barcode assets in an org. + +### EXAMPLE 2 +``` +Get-SmaBarcodeAsset -BarcodeId 1 +``` + +Retrieves information a specific barcode within an org. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +(Optional) Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the barcode asset to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: BarcodeId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaCurrentUserAccount.md b/docs/Get-SmaCurrentUserAccount.md new file mode 100644 index 0000000..1f1fa9f --- /dev/null +++ b/docs/Get-SmaCurrentUserAccount.md @@ -0,0 +1,73 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaCurrentUserAccount.md +schema: 2.0.0 +--- + +# Get-SmaCurrentUserAccount + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaCurrentUserAccount [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about the current SMA user account being used to perform the api query. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaCurrentUserAccount +``` + +Retrieves information about the current API user performing the query. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaMachineInventory.md b/docs/Get-SmaMachineInventory.md new file mode 100644 index 0000000..01cdc55 --- /dev/null +++ b/docs/Get-SmaMachineInventory.md @@ -0,0 +1,111 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaMachineInventory.md +schema: 2.0.0 +--- + +# Get-SmaMachineInventory + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaMachineInventory [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about the SMA inventory, or a specific device. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaMachineInventory +``` + +Retrieves machine information about all inventory devices in an org. + +### EXAMPLE 2 +``` +Get-SmaMachineInventory -MachineID 1234 +``` + +Retrieves machine information about an inventory device with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: MachineId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaMachineProcess.md b/docs/Get-SmaMachineProcess.md new file mode 100644 index 0000000..a7753b1 --- /dev/null +++ b/docs/Get-SmaMachineProcess.md @@ -0,0 +1,111 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaMachineProcess.md +schema: 2.0.0 +--- + +# Get-SmaMachineProcess + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaMachineProcess [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about the SMA inventory processes, or a specific process. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaMachineProcess +``` + +Retrieves machine information about all inventory devices in an org. + +### EXAMPLE 2 +``` +Get-SmaMachineProcess -ProcessID 1234 +``` + +Retrieves inventory process information about a process with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: ProcessId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaMachineService.md b/docs/Get-SmaMachineService.md new file mode 100644 index 0000000..16ab3a2 --- /dev/null +++ b/docs/Get-SmaMachineService.md @@ -0,0 +1,111 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaMachineService.md +schema: 2.0.0 +--- + +# Get-SmaMachineService + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaMachineService [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about the SMA inventory services, or a specific service. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaMachineService -Server https://kace.example.com -Org Default -Credential (Get-Credential) +``` + +Retrieves service information about all inventory devices + +### EXAMPLE 2 +``` +Get-SmaMachineService -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ServiceID 1234 +``` + +Retrieves inventory service information about a service with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: ServiceId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaManagedInstall.md b/docs/Get-SmaManagedInstall.md new file mode 100644 index 0000000..314e907 --- /dev/null +++ b/docs/Get-SmaManagedInstall.md @@ -0,0 +1,134 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaManagedInstall.md +schema: 2.0.0 +--- + +# Get-SmaManagedInstall + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaManagedInstall [-Id <Int32>] [-ListCompatibleMachines] [[-QueryParameters] <String>] [-WhatIf] + [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about SMA managed installs. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaManagedInstall +``` + +Retrieves information about all managed installs. + +### EXAMPLE 2 +``` +Get-SmaManagedInstall -ManagedInstallID 1234 +``` + +Retrieves information for a managed install with ID 1234. + +### EXAMPLE 3 +``` +Get-SmaManagedInstall -ManagedInstallID 1234 -ListCompatibleMachines +``` + +Retrieves machines compatible with `-managedinstallID 1234` + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ListCompatibleMachines +Use with -ManagedInstallID if you want to return all machines compatible with a specific managed install. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: ManagedInstallId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaManagedInstallMachineCompatibility.md b/docs/Get-SmaManagedInstallMachineCompatibility.md new file mode 100644 index 0000000..d67185c --- /dev/null +++ b/docs/Get-SmaManagedInstallMachineCompatibility.md @@ -0,0 +1,105 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaManagedInstallMachineCompatibility.md +schema: 2.0.0 +--- + +# Get-SmaManagedInstallMachineCompatibility + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaManagedInstallMachineCompatibility -Id <Int32> [[-QueryParameters] <String>] [-WhatIf] [-Confirm] + [<CommonParameters>] +``` + +## DESCRIPTION +Returns managed installs associated with a machine ID. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaManagedInstallMachineCompatibility -MachineID 1234 +``` + +Retrieves managed install information about an inventory device with ID 1234 + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: MachineId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaOperatingSystemInventory.md b/docs/Get-SmaOperatingSystemInventory.md new file mode 100644 index 0000000..dab75ed --- /dev/null +++ b/docs/Get-SmaOperatingSystemInventory.md @@ -0,0 +1,112 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaOperatingSystemInventory.md +schema: 2.0.0 +--- + +# Get-SmaOperatingSystemInventory + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaOperatingSystemInventory [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] + [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about operating systems for SMA inventory devices, or for specific inventory device. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaOperatingSystemInventory +``` + +Retrieves information about all inventory device operating systems. + +### EXAMPLE 2 +``` +Get-SmaOperatingSystemInventory -MachineID 1234 +``` + +Retrieves operating system information for an inventory device with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: MachineId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaReportingDefinition.md b/docs/Get-SmaReportingDefinition.md new file mode 100644 index 0000000..39ae4be --- /dev/null +++ b/docs/Get-SmaReportingDefinition.md @@ -0,0 +1,160 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaReportingDefinition.md +schema: 2.0.0 +--- + +# Get-SmaReportingDefinition + +## SYNOPSIS + +## SYNTAX + +### Id (Default) +``` +Get-SmaReportingDefinition [-QueryParameters <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +### A +``` +Get-SmaReportingDefinition [-Id <Int32>] [-QueryParameters <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +### B +``` +Get-SmaReportingDefinition [-Name <String>] [-QueryParameters <String>] [-WhatIf] [-Confirm] + [<CommonParameters>] +``` + +### C +``` +Get-SmaReportingDefinition [-Field <String>] [-QueryParameters <String>] [-WhatIf] [-Confirm] + [<CommonParameters>] +``` + +## DESCRIPTION +Return reporting definitions + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Get-SmaReportingDefinition +``` + +Returns all reporting definions + +### EXAMPLE 2 + +```powershell +Get-SmaReportingDefinition -DefinitionID 1234 -QueryParameters "?orgID=1" +``` + +This will return the reporting definitions for report ID 1234 in ORG 1. Org MUST be specified in the query parameters. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Field +{{ Fill Field Description }} + +```yaml +Type: String +Parameter Sets: C +Aliases: DefinitionField + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: A +Aliases: DefinitionId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Name +{{ Fill Name Description }} + +```yaml +Type: String +Parameter Sets: B +Aliases: DefinitionName + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaScript.md b/docs/Get-SmaScript.md new file mode 100644 index 0000000..f2675a0 --- /dev/null +++ b/docs/Get-SmaScript.md @@ -0,0 +1,111 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaScript.md +schema: 2.0.0 +--- + +# Get-SmaScript + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaScript [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about a specific script. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SmaScript +``` + +Retrieves information about all scripts in the org. + +### EXAMPLE 2 +``` +Get-SmaScript -ScriptID 1234 +``` + +Retrieves information about a script with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: ScriptId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaScriptDependency.md b/docs/Get-SmaScriptDependency.md new file mode 100644 index 0000000..468bbfa --- /dev/null +++ b/docs/Get-SmaScriptDependency.md @@ -0,0 +1,104 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaScriptDependency.md +schema: 2.0.0 +--- + +# Get-SmaScriptDependency + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaScriptDependency -Id <Int32> [[-DependencyName] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about dependencies for a specific script. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +PS> Get-SmaScriptDependency -ScriptID 1234 +``` + +Retrieves information about the dependencies for a script with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DependencyName +(Optional) The ID of the dependency for a specific script you want to retrieve. +If omitted, will return all dependencies + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: ScriptId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaScriptRunStatus.md b/docs/Get-SmaScriptRunStatus.md new file mode 100644 index 0000000..7dcefaf --- /dev/null +++ b/docs/Get-SmaScriptRunStatus.md @@ -0,0 +1,89 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaScriptRunStatus.md +schema: 2.0.0 +--- + +# Get-SmaScriptRunStatus + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaScriptRunStatus -Id <Int32> [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about the status of a running script using the runID. +Equivalent to the 'Run Now Status' in the SMA admin page. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Get-SmaScriptRunStatus -RunID 1234 +``` + +Retrieves the runStatus of job with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: RunId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaScriptTask.md b/docs/Get-SmaScriptTask.md new file mode 100644 index 0000000..69c0e76 --- /dev/null +++ b/docs/Get-SmaScriptTask.md @@ -0,0 +1,110 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaScriptTask.md +schema: 2.0.0 +--- + +# Get-SmaScriptTask + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaScriptTask -Id <Int32> [-OrdinalID <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns task information about a specific script. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +PS> Get-SmaScriptTask -ScriptID 1234 +``` + +Retrieves task information about a script with ID 1234. + +### EXAMPLE 2 +```powershell +PS> Get-SmaScript 1234 | Get-SmaScriptTask +``` + +Uses pipeline to retrieves task information about a script with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: ScriptId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -OrdinalID +{{ Fill OrdinalID Description }} + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: OrderId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaServiceDeskQueue.md b/docs/Get-SmaServiceDeskQueue.md new file mode 100644 index 0000000..00e4b7c --- /dev/null +++ b/docs/Get-SmaServiceDeskQueue.md @@ -0,0 +1,111 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaServiceDeskQueue.md +schema: 2.0.0 +--- + +# Get-SmaServiceDeskQueue + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaServiceDeskQueue [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about service desk queues. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Get-SmaServiceDeskQueues +``` + +Retrieves information about all queues in the org. + +### EXAMPLE 2 +```powershell +Get-SmaServiceDeskQueues -QueueID 1234 +``` + +Retrieves information about a queue with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: QueueId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaServiceDeskQueueField.md b/docs/Get-SmaServiceDeskQueueField.md new file mode 100644 index 0000000..48dc851 --- /dev/null +++ b/docs/Get-SmaServiceDeskQueueField.md @@ -0,0 +1,105 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaServiceDeskQueueField.md +schema: 2.0.0 +--- + +# Get-SmaServiceDeskQueueField + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaServiceDeskQueueField -Id <Int32> [[-QueryParameters] <String>] [-WhatIf] [-Confirm] + [<CommonParameters>] +``` + +## DESCRIPTION +Returns a list of all a queue’s fields. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Get-SmaServiceDeskQueueField -QueueID 1234 +``` + +Retrieves queue field information about a queue with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: QueueId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaServiceDeskTicket.md b/docs/Get-SmaServiceDeskTicket.md new file mode 100644 index 0000000..092b733 --- /dev/null +++ b/docs/Get-SmaServiceDeskTicket.md @@ -0,0 +1,113 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaServiceDeskTicket.md +schema: 2.0.0 +--- + +# Get-SmaServiceDeskTicket + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaServiceDeskTicket [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns a list of all tickets. +Sub-entities that can be used on shaping and filtering directives include owner, +submitter, queue, category, priority, status, machine, asset, related_tickets, referring_tickets + +## EXAMPLES + +### EXAMPLE 1 +```powershell +PS> Get-SmaServiceDeskTicket -QueryParameters "?filtering=hd_status.name eq new" +``` + +Retrieves all tickets with a status of `new` + +### EXAMPLE 2 +```powershell +Get-SmaServiceDeskTicket -TicketID 1234 -QueryParameters "?shaping= hd_ticket regular,owner limited,submitter limited" +``` + +Retrieves the standard attributes, plus owner and submitter for ticket ID 1234 + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: TicketId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaServiceDeskTicketChanges.md b/docs/Get-SmaServiceDeskTicketChanges.md new file mode 100644 index 0000000..2183e0f --- /dev/null +++ b/docs/Get-SmaServiceDeskTicketChanges.md @@ -0,0 +1,105 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaServiceDeskTicketChanges.md +schema: 2.0.0 +--- + +# Get-SmaServiceDeskTicketChanges + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaServiceDeskTicketChanges -Id <Int32> [[-QueryParameters] <String>] [-WhatIf] [-Confirm] + [<CommonParameters>] +``` + +## DESCRIPTION +Returns a list of all ticket changes to a given ticket. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Get-SmaServiceDeskTicketChanges -TicketID 1234 +``` + +Retrieves the ticket changes for ticket 1234 + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: TicketId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaServiceDeskTicketTemplate.md b/docs/Get-SmaServiceDeskTicketTemplate.md new file mode 100644 index 0000000..b3d8852 --- /dev/null +++ b/docs/Get-SmaServiceDeskTicketTemplate.md @@ -0,0 +1,105 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaServiceDeskTicketTemplate.md +schema: 2.0.0 +--- + +# Get-SmaServiceDeskTicketTemplate + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaServiceDeskTicketTemplate -Id <Int32> [[-QueryParameters] <String>] [-WhatIf] [-Confirm] + [<CommonParameters>] +``` + +## DESCRIPTION +Returns a ticket template for the specified queue, usable for ticket creation. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Get-SmaServiceDeskTicketTemplate -QueueID 1234 +``` + +Retrieves information about a queue with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: QueueId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaSoftwareInventory.md b/docs/Get-SmaSoftwareInventory.md new file mode 100644 index 0000000..b8b134a --- /dev/null +++ b/docs/Get-SmaSoftwareInventory.md @@ -0,0 +1,111 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaSoftwareInventory.md +schema: 2.0.0 +--- + +# Get-SmaSoftwareInventory + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaSoftwareInventory [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about SMA software titles, or for specific software title. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Get-SmaSoftwareInventory +``` + +Retrieves information about all software titles in the SMA. + +### EXAMPLE 2 +```powershell +Get-SmaSoftwareInventory -SoftwareID 1234 +``` + +Retrieves information for a software title with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: SoftwareId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaStartupProgramInventory.md b/docs/Get-SmaStartupProgramInventory.md new file mode 100644 index 0000000..315aaeb --- /dev/null +++ b/docs/Get-SmaStartupProgramInventory.md @@ -0,0 +1,112 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaStartupProgramInventory.md +schema: 2.0.0 +--- + +# Get-SmaStartupProgramInventory + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaStartupProgramInventory [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] + [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about startup programs from SMA inventory devices, or for specific startup program. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Get-SmaStartupProgramInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) +``` + +Retrieves information about all inventory devices' startup programs. + +### EXAMPLE 2 +```powershell +Get-SmaStartupProgramInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ProgramID 1234 +``` + +Retrieves information for a startup program with ID 1234. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: ProgramId + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Get-SmaUserPermissions.md b/docs/Get-SmaUserPermissions.md new file mode 100644 index 0000000..9ba1045 --- /dev/null +++ b/docs/Get-SmaUserPermissions.md @@ -0,0 +1,104 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaUserPermissions.md +schema: 2.0.0 +--- + +# Get-SmaUserPermissions + +## SYNOPSIS + +## SYNTAX + +``` +Get-SmaUserPermissions -Id <Int32> [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Returns information about an SMA user permissions. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Get-SmaUserPermissions -Server https://kace.example.com -Org Default -Credential (Get-Credential) -UserID 1234 +``` + +Retrieves information about the permissions for a user with ID 1234 + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueryParameters +Any additional query parameters to be included. +String must begin with a '?' character. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: AssetId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Invoke-SmaScript.md b/docs/Invoke-SmaScript.md new file mode 100644 index 0000000..8f0641f --- /dev/null +++ b/docs/Invoke-SmaScript.md @@ -0,0 +1,107 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Invoke-SmaScript.md +schema: 2.0.0 +--- + +# Invoke-SmaScript + +## SYNOPSIS + +## SYNTAX + +``` +Invoke-SmaScript -Id <Int32> [-TargetMachineID] <Array> [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Runs a specified script agains a list of given machineIDs + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Invoke-SmaScript -ScriptID 1234 -TargetMachineIDs 5678,2345,4567 +``` + +Runs a script with ID 1234 against machines with IDs 5678,2345,4567 + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetMachineID +Specifies the machine ids to target. Multiples should be comma-seperated. + +```yaml +Type: Array +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: ScriptId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Int32 + +## NOTES +output 0=Failure + +output non-0 = the given runNow ID + +## RELATED LINKS diff --git a/docs/New-SmaAsset.md b/docs/New-SmaAsset.md new file mode 100644 index 0000000..cad5de6 --- /dev/null +++ b/docs/New-SmaAsset.md @@ -0,0 +1,100 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/New-SmaAsset.md +schema: 2.0.0 +--- + +# New-SmaAsset + +## SYNOPSIS + +## SYNTAX + +``` +New-SmaAsset [-Body] <Hashtable> [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Creates a new SMA asset. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +PS> $NewAgentAsset = @{ + 'Assets' =@( + @{ + 'name'='x2test' + "asset_type_id" = 5 + 'location_id' = 1 + 'asset_type_name' = "Computer with Dell Agent" + } + ) +} + +PS> New-SmaAsset -Body $NewAgentAsset +``` + +Creates a new SMA asset or type 'Computer with Dell Agent'. + +## PARAMETERS + +### -Body +A hashtable-formatted payload containing the asset information. +See example. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/New-SmaScriptTask.md b/docs/New-SmaScriptTask.md new file mode 100644 index 0000000..45824aa --- /dev/null +++ b/docs/New-SmaScriptTask.md @@ -0,0 +1,119 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/New-SmaScriptTask.md +schema: 2.0.0 +--- + +# New-SmaScriptTask + +## SYNOPSIS + +## SYNTAX + +``` +New-SmaScriptTask -Id <Int32> [-Body] <Hashtable> [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Creates a new script task for a given script ID. +Works with online and offline kscripts. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +$taskparams = @{ +'attempts' = 2 + 'onFailure' = 'break' + 'onRemediationFailure' = @( + @{ + 'id'= 27 # status ID + 'params'= [ordered]@{ + 'type'='status' + 'message'='this is a test message' + } + } + ) +} + +New-SmaScriptTask -ScriptID 1234 -Body $taskparams +``` + +Creates a new task for script ID 1234, gives it 2 attempts with a break on failure. +On remediation failure, it logs a status message. + +## PARAMETERS + +### -Body +A hashtable-formatted payload with instructions for the task to create. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: ScriptId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/New-SmaServiceDeskTicket.md b/docs/New-SmaServiceDeskTicket.md new file mode 100644 index 0000000..59bdd9f --- /dev/null +++ b/docs/New-SmaServiceDeskTicket.md @@ -0,0 +1,101 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/New-SmaServiceDeskTicket.md +schema: 2.0.0 +--- + +# New-SmaServiceDeskTicket + +## SYNOPSIS + +## SYNTAX + +``` +New-SmaServiceDeskTicket [-Body] <Hashtable> [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Creates a new SMA service desk ticket. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +PS> $NewTicket = @{ + 'Tickets' =@( + @{ + 'title' = 'test-ticket' + 'hd_queue_id' = 7 # queue ID + 'submitter' = 10 # submitter ID + 'category' = 1 # category ID + "custom_1" = 'my_custom_text' + } + ) +} + +PS> New-SmaTicket -Body $NewTicket +``` + +Creates a new SMA ticket for a user with ID of 1234 + +## PARAMETERS + +### -Body +A hashtable-formatted payload containing the ticket information. +See example. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Remove-SmaServiceDeskTicket.md b/docs/Remove-SmaServiceDeskTicket.md new file mode 100644 index 0000000..1bc22e1 --- /dev/null +++ b/docs/Remove-SmaServiceDeskTicket.md @@ -0,0 +1,88 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Remove-SmaServiceDeskTicket.md +schema: 2.0.0 +--- + +# Remove-SmaServiceDeskTicket + +## SYNOPSIS + +## SYNTAX + +``` +Remove-SmaServiceDeskTicket -Id <Int32> [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Deletes a service desk ticket. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +PS> Remove-SmaServiceDeskTicket -TicketID 1234 +``` + +Deletes a ticket with ID 1234 + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: TicketId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Set-SmaAsset.md b/docs/Set-SmaAsset.md new file mode 100644 index 0000000..d3db31f --- /dev/null +++ b/docs/Set-SmaAsset.md @@ -0,0 +1,113 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Set-SmaAsset.md +schema: 2.0.0 +--- + +# Set-SmaAsset + +## SYNOPSIS + +## SYNTAX + +``` +Set-SmaAsset -Id <Int32> [-Body] <Hashtable> [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Updates an SMA asset. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +PS> $SetAssetBody = @{ + 'Assets' = @( + @{ + 'id' = 10000 + 'field_10000' = 'My String' + } + ) +} + +PS> Set-SmaAsset -Body $SetAssetBody +``` + +Updates the field 'field_10000' with string 'My String' on asset with ID 1234. Get asset field identities using Get-SmaAsset with query parameters `"?shaping=asset all"` on a similar asset if needed. + +## PARAMETERS + +### -Body +A hashtable-formatted payload containing the asset information. +See example. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: AssetId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Set-SmaAssetAsArchived.md b/docs/Set-SmaAssetAsArchived.md new file mode 100644 index 0000000..7bac18f --- /dev/null +++ b/docs/Set-SmaAssetAsArchived.md @@ -0,0 +1,108 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Set-SmaAssetAsArchived.md +schema: 2.0.0 +--- + +# Set-SmaAssetAsArchived + +## SYNOPSIS + +## SYNTAX + +``` +Set-SmaAssetAsArchived -Id <Int32> [-Body] <Hashtable> [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Archives an existing SMA asset. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +PS> $Body = @{ + archiveReason = "Testing Archival via API" + } + +PS> Set-SmaAssetAsArchived -AssetID 1234 -Body $Body +``` + +Archives an asset with ID 1234 with the reason "Testing Archival via API" + +## PARAMETERS + +### -Body +A hashtable-formatted payload containing the asset information. +See example. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: AssetId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Set-SmaMachineInventory.md b/docs/Set-SmaMachineInventory.md new file mode 100644 index 0000000..f473ae7 --- /dev/null +++ b/docs/Set-SmaMachineInventory.md @@ -0,0 +1,113 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Set-SmaMachineInventory.md +schema: 2.0.0 +--- + +# Set-SmaMachineInventory + +## SYNOPSIS + +## SYNTAX + +``` +Set-SmaMachineInventory -Id <Int32> -Body <Hashtable> [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Updates the inventory information for a device. + +## EXAMPLES + +### Example 1 +```powershell +PS> $Body = @{ + 'Machines' = @( + @{ + 'id' = 1234 + 'notes' = ((Get-Date).tostring()) + + } + ) +} + +PS> Set-SmaMachineInventory -MachineID 1234 +``` + +Updates the notes field for machine ID 1234. Specified ID in body must match `-MachineID` parameter. + +## PARAMETERS + +### -Body +The payload of the update, in hashtable format. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: MachineId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/docs/Set-SmaServiceDeskTicket.md b/docs/Set-SmaServiceDeskTicket.md new file mode 100644 index 0000000..8d60954 --- /dev/null +++ b/docs/Set-SmaServiceDeskTicket.md @@ -0,0 +1,113 @@ +--- +external help file: KaceSMA-help.xml +Module Name: KaceSMA +online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Set-SmaServiceDeskTicket.md +schema: 2.0.0 +--- + +# Set-SmaServiceDeskTicket + +## SYNOPSIS + +## SYNTAX + +``` +Set-SmaServiceDeskTicket -Id <Int32> -Body <Hashtable> [-WhatIf] [-Confirm] [<CommonParameters>] +``` + +## DESCRIPTION +Updates a ticket. + +## EXAMPLES + +### EXAMPLE 1 +```powershell +PS> $processedBody = @{ + 'Tickets' = @( + @{ + status = 1 # status ID + 'custom_14' = "my value for custom_14" + 'resolution' = "my resolution" + } + ) +} + +PS> Set-SmaServiceDeskTicket -TicketID 1234 -Body $TicketUpdate +``` + +Updates a ticket with ID 1234 with the information provided by the $body. + +## PARAMETERS + +### -Body +The payload of the update, in hashtable format. See example. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Specifies the id of the item to query. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: TicketId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### PSCustomObject +## NOTES + +## RELATED LINKS diff --git a/en-US/KaceSMA-help.xml b/en-US/KaceSMA-help.xml new file mode 100644 index 0000000..d983944 --- /dev/null +++ b/en-US/KaceSMA-help.xml @@ -0,0 +1,5109 @@ +<?xml version="1.0" encoding="utf-8"?> +<helpItems schema="maml" xmlns="http://msh"> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Connect-SmaServer</command:name> + <command:verb>Connect</command:verb> + <command:noun>SmaServer</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Connect to a SMA server. This command generates an access token to be used during the same session. This token has an expiration of 1 hour, after which you must authenticate again.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Connect-SmaServer</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>Server</maml:name> + <maml:Description> + <maml:para>The FQDN of the appliance. Must begin with `https://`</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>Org</maml:name> + <maml:Description> + <maml:para>The SMA org to connect to.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> + <maml:name>Credential</maml:name> + <maml:Description> + <maml:para>The credentials of the user authenticating to the SMA Server</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> + <dev:type> + <maml:name>PSCredential</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> + <maml:name>Credential</maml:name> + <maml:Description> + <maml:para>The credentials of the user authenticating to the SMA Server</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> + <dev:type> + <maml:name>PSCredential</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>Org</maml:name> + <maml:Description> + <maml:para>The SMA org to connect to.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>Server</maml:name> + <maml:Description> + <maml:para>The FQDN of the appliance. Must begin with `https://`</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes> + <command:inputType> + <dev:type> + <maml:name>None</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:inputType> + </command:inputTypes> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>System.PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- Example 1 --------------------------</maml:title> + <dev:code>PS C:\> Connect-SmaServer -Server 'https://kace.example.com' -Org 'Default' -Credential (Get-Credential) + +Server Org Status Protocol User +------ ---- ------ -------- ---- +kace.example.com Default Connected HTTPS my_user</dev:code> + <dev:remarks> + <maml:para>Connects to the default org of a Kace SMA Server.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Connect-SmaServer.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaAgentlessInventory</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaAgentlessInventory</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about the SMA agentless inventory, or a specific node.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaAgentlessInventory</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>NodesID</maml:name> + <maml:Description> + <maml:para>Specifies the node to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>NodesID</maml:name> + <maml:Description> + <maml:para>Specifies the node to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaAgentlessInventory</dev:code> + <dev:remarks> + <maml:para>Retrieves information about all agentless inventory nodes</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaAgentlessInventory -NodeID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves node information about an agentless node with with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaAgentlessInventory.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaAsset</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaAsset</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about an SMA asset.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaAsset</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>AssetID</maml:name> + <maml:Description> + <maml:para>Specifies the asset to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>AsBarcodes</maml:name> + <maml:Description> + <maml:para>Will return all barcodes associated with the requested assets. Can be used either with `-AssetID` parameter or with all assets.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>AsBarcodes</maml:name> + <maml:Description> + <maml:para>Will return all barcodes associated with the requested assets. Can be used either with `-AssetID` parameter or with all assets.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>AssetID</maml:name> + <maml:Description> + <maml:para>Specifies the asset to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaAsset</dev:code> + <dev:remarks> + <maml:para>Retrieves information for all SMA assets.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaAsset -AssetID 5678</dev:code> + <dev:remarks> + <maml:para>Retrieves information about an asset with ID 5678.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title> + <dev:code>Get-SmaAsset -AssetID 5678 -AsBarcodes</dev:code> + <dev:remarks> + <maml:para>Retrieves barcode information about an asset with ID 5678.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaAsset.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaAssetType</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaAssetType</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about an SMA asset type.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaAssetType</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaAssetType</dev:code> + <dev:remarks> + <maml:para>Retrieves information about all asset types within an org.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaAssetType.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaBarcodeAsset</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaBarcodeAsset</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about an SMA barcode.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaBarcodeAsset</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>BarcodeID</maml:name> + <maml:Description> + <maml:para>Specifies the barcode asset to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>(Optional) Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>BarcodeID</maml:name> + <maml:Description> + <maml:para>Specifies the barcode asset to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>(Optional) Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaBarcodeAsset</dev:code> + <dev:remarks> + <maml:para>Retrieves information about all barcode assets in an org.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaBarcodeAsset -BarcodeId 1</dev:code> + <dev:remarks> + <maml:para>Retrieves information a specific barcode within an org.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaBarcodeAsset.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaCurrentUserAccount</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaCurrentUserAccount</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about the current SMA user account being used to perform the api query.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaCurrentUserAccount</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaCurrentUserAccount</dev:code> + <dev:remarks> + <maml:para>Retrieves information about the current API user performing the query.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaCurrentUserAccount.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaMachineInventory</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaMachineInventory</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about the SMA inventory, or a specific device.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaMachineInventory</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>MachineID</maml:name> + <maml:Description> + <maml:para>Specifies the machine to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>MachineID</maml:name> + <maml:Description> + <maml:para>Specifies the machine to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaMachineInventory</dev:code> + <dev:remarks> + <maml:para>Retrieves machine information about all inventory devices in an org.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaMachineInventory -MachineID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves machine information about an inventory device with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaMachineInventory.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaMachineProcess</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaMachineProcess</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about the SMA inventory processes, or a specific process.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaMachineProcess</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ProcessID</maml:name> + <maml:Description> + <maml:para>Specifies the machine process to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ProcessID</maml:name> + <maml:Description> + <maml:para>Specifies the machine process to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaMachineProcess</dev:code> + <dev:remarks> + <maml:para>Retrieves machine information about all inventory devices in an org.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaMachineProcess -ProcessID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves inventory process information about a process with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaMachineProcess.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaMachineService</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaMachineService</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about the SMA inventory services, or a specific service.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaMachineService</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ServiceID</maml:name> + <maml:Description> + <maml:para>Specifies the machine service to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ServiceID</maml:name> + <maml:Description> + <maml:para>Specifies the machine service to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaMachineService -Server https://kace.example.com -Org Default -Credential (Get-Credential)</dev:code> + <dev:remarks> + <maml:para>Retrieves service information about all inventory devices</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaMachineService -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ServiceID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves inventory service information about a service with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaMachineService.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaManagedInstall</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaManagedInstall</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about SMA managed installs.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaManagedInstall</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ManagedInstallID</maml:name> + <maml:Description> + <maml:para>Specifies the managed install to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>ListCompatibleMachines</maml:name> + <maml:Description> + <maml:para>Use with -ManagedInstallID if you want to return all machines compatible with a specific managed install.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>ListCompatibleMachines</maml:name> + <maml:Description> + <maml:para>Use with -ManagedInstallID if you want to return all machines compatible with a specific managed install.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ManagedInstallID</maml:name> + <maml:Description> + <maml:para>Specifies the managed install to return from the SMA.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaManagedInstall</dev:code> + <dev:remarks> + <maml:para>Retrieves information about all managed installs.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaManagedInstall -ManagedInstallID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves information for a managed install with ID 1234.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title> + <dev:code>Get-SmaManagedInstall -ManagedInstallID 1234 -ListCompatibleMachines</dev:code> + <dev:remarks> + <maml:para>Retrieves machines compatible with `-managedinstallID 1234`</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaManagedInstall.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaManagedInstallMachineCompatibility</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaManagedInstallMachineCompatibility</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns managed installs associated with a machine ID.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaManagedInstallMachineCompatibility</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>MachineID</maml:name> + <maml:Description> + <maml:para>Specifies the machine to return managed install information for.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>MachineID</maml:name> + <maml:Description> + <maml:para>Specifies the machine to return managed install information for.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaManagedInstallMachineCompatibility -MachineID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves managed install information about an inventory device with ID 1234</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaManagedInstallMachineCompatibility.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaOperatingSystemInventory</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaOperatingSystemInventory</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about operating systems for SMA inventory devices, or for specific inventory device.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaOperatingSystemInventory</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>MachineID</maml:name> + <maml:Description> + <maml:para>Specifies the machine to return operating system information about.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>MachineID</maml:name> + <maml:Description> + <maml:para>Specifies the machine to return operating system information about.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaOperatingSystemInventory</dev:code> + <dev:remarks> + <maml:para>Retrieves information about all inventory device operating systems.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaOperatingSystemInventory -MachineID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves operating system information for an inventory device with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaOperatingSystemInventory.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaReportingDefinition</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaReportingDefinition</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Return reporting definitions</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaReportingDefinition</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>DefinitionID</maml:name> + <maml:Description> + <maml:para>Specifies the definition ID to return.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + <command:syntaxItem> + <maml:name>Get-SmaReportingDefinition</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>DefinitionName</maml:name> + <maml:Description> + <maml:para>Specifies the definition name to return.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + <command:syntaxItem> + <maml:name>Get-SmaReportingDefinition</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>DistinctField</maml:name> + <maml:Description> + <maml:para>Specifies the distinct field to return.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>DefinitionID</maml:name> + <maml:Description> + <maml:para>Specifies the definition ID to return.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>DefinitionName</maml:name> + <maml:Description> + <maml:para>Specifies the definition name to return.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>DistinctField</maml:name> + <maml:Description> + <maml:para>Specifies the distinct field to return.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaReportingDefinition</dev:code> + <dev:remarks> + <maml:para>Returns all reporting definions</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaReportingDefinition -DefinitionID 1234 -QueryParameters "?orgID=1"</dev:code> + <dev:remarks> + <maml:para>This will return the reporting definitions for report ID 1234 in ORG 1. Org MUST be specified in the query parameters.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaReportingDefinition.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaScript</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaScript</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about a specific script.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaScript</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ScriptID</maml:name> + <maml:Description> + <maml:para>Specifies the script to return information about.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ScriptID</maml:name> + <maml:Description> + <maml:para>Specifies the script to return information about.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaScript</dev:code> + <dev:remarks> + <maml:para>Retrieves information about all scripts in the org.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaScript -ScriptID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves information about a script with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaScript.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaScriptDependency</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaScriptDependency</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about dependencies for a specific script.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaScriptDependency</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ScriptID</maml:name> + <maml:Description> + <maml:para>The ID of the script whose dependencies you want to retrieve.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>DependencyName</maml:name> + <maml:Description> + <maml:para>(Optional) The ID of the dependency for a specific script you want to retrieve. If omitted, will return all dependencies</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>DependencyName</maml:name> + <maml:Description> + <maml:para>(Optional) The ID of the dependency for a specific script you want to retrieve. If omitted, will return all dependencies</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ScriptID</maml:name> + <maml:Description> + <maml:para>The ID of the script whose dependencies you want to retrieve.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>PS> Get-SmaScriptDependency -ScriptID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves information about the dependencies for a script with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaScriptDependency.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaScriptRunStatus</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaScriptRunStatus</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about the status of a running script using the runID. Equivalent to the 'Run Now Status' in the SMA admin page.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaScriptRunStatus</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>RunID</maml:name> + <maml:Description> + <maml:para>Specifies the job status to return.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>RunID</maml:name> + <maml:Description> + <maml:para>Specifies the job status to return.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaScriptRunStatus -RunID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves the runStatus of job with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaScriptRunStatus.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaScriptTask</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaScriptTask</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns task information about a specific script.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaScriptTask</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ScriptID</maml:name> + <maml:Description> + <maml:para>The ID of the script who's tasks you'd like information about.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>OrderID</maml:name> + <maml:Description> + <maml:para>(Optional) The order (ordinal) ID of a specific task to be returned. The first task in a script is ordinal ID 0, and increments from there.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>OrderID</maml:name> + <maml:Description> + <maml:para>(Optional) The order (ordinal) ID of a specific task to be returned. The first task in a script is ordinal ID 0, and increments from there.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ScriptID</maml:name> + <maml:Description> + <maml:para>The ID of the script who's tasks you'd like information about.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>PS> Get-SmaScriptTask -ScriptID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves task information about a script with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaScriptTask.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaServiceDeskQueue</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaServiceDeskQueue</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about service desk queues.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaServiceDeskQueue</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>QueueID</maml:name> + <maml:Description> + <maml:para>Specifies the queue to be returned.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>QueueID</maml:name> + <maml:Description> + <maml:para>Specifies the queue to be returned.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaServiceDeskQueues</dev:code> + <dev:remarks> + <maml:para>Retrieves information about all queues in the org.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaServiceDeskQueues -QueueID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves information about a queue with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaServiceDeskQueue.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaServiceDeskQueueField</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaServiceDeskQueueField</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns a list of all a queue’s fields.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaServiceDeskQueueField</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>QueueID</maml:name> + <maml:Description> + <maml:para>Specifies the queue ID to return field information about.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>QueueID</maml:name> + <maml:Description> + <maml:para>Specifies the queue ID to return field information about.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaServiceDeskQueueField -QueueID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves queue field information about a queue with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaServiceDeskQueueField.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaServiceDeskTicket</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaServiceDeskTicket</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns a list of all tickets. Sub-entities that can be used on shaping and filtering directives include owner, submitter, queue, category, priority, status, machine, asset, related_tickets, referring_tickets</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaServiceDeskTicket</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>TicketID</maml:name> + <maml:Description> + <maml:para>Specifies the ticket to return data for.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>TicketID</maml:name> + <maml:Description> + <maml:para>Specifies the ticket to return data for.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>PS> Get-SmaServiceDeskTicket -QueryParameters "?filtering=hd_status.name eq new"</dev:code> + <dev:remarks> + <maml:para>Retrieves all tickets with a status of `new`</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaServiceDeskTicket -TicketID 1234 -QueryParameters "?shaping= hd_ticket regular,owner limited,submitter limited"</dev:code> + <dev:remarks> + <maml:para>Retrieves the standard attributes, plus owner and submitter for ticket ID 1234</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaServiceDeskTicket.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaServiceDeskTicketChanges</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaServiceDeskTicketChanges</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns a list of all ticket changes to a given ticket.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaServiceDeskTicketChanges</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>TicketID</maml:name> + <maml:Description> + <maml:para>Specifies the ticket to receive changes for.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>TicketID</maml:name> + <maml:Description> + <maml:para>Specifies the ticket to receive changes for.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaServiceDeskTicketChanges -TicketID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves the ticket changes for ticket 1234</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaServiceDeskTicketChanges.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaServiceDeskTicketTemplate</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaServiceDeskTicketTemplate</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns a ticket template for the specified queue, usable for ticket creation.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaServiceDeskTicketTemplate</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>QueueID</maml:name> + <maml:Description> + <maml:para>Specifies the queue id for which to retrieve template information.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>QueueID</maml:name> + <maml:Description> + <maml:para>Specifies the queue id for which to retrieve template information.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaServiceDeskTicketTemplate -QueueID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves information about a queue with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaServiceDeskTicketTemplate.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaSoftwareInventory</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaSoftwareInventory</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about SMA software titles, or for specific software title.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaSoftwareInventory</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>SoftwareID</maml:name> + <maml:Description> + <maml:para>Specifies the software title id to retrieve.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>SoftwareID</maml:name> + <maml:Description> + <maml:para>Specifies the software title id to retrieve.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaSoftwareInventory</dev:code> + <dev:remarks> + <maml:para>Retrieves information about all software titles in the SMA.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaSoftwareInventory -SoftwareID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves information for a software title with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaSoftwareInventory.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaStartupProgramInventory</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaStartupProgramInventory</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about startup programs from SMA inventory devices, or for specific startup program.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaStartupProgramInventory</maml:name> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ProgramID</maml:name> + <maml:Description> + <maml:para>Specifies the program ID to retrieve.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ProgramID</maml:name> + <maml:Description> + <maml:para>Specifies the program ID to retrieve.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaStartupProgramInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential)</dev:code> + <dev:remarks> + <maml:para>Retrieves information about all inventory devices' startup programs.</maml:para> + </dev:remarks> + </command:example> + <command:example> + <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> + <dev:code>Get-SmaStartupProgramInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ProgramID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves information for a startup program with ID 1234.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaStartupProgramInventory.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Get-SmaUserPermissions</command:name> + <command:verb>Get</command:verb> + <command:noun>SmaUserPermissions</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Returns information about an SMA user permissions.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Get-SmaUserPermissions</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>UserID</maml:name> + <maml:Description> + <maml:para>Specifies the user ID to retrieve</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>QueryParameters</maml:name> + <maml:Description> + <maml:para>Any additional query parameters to be included. String must begin with a '?' character.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>UserID</maml:name> + <maml:Description> + <maml:para>Specifies the user ID to retrieve</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Get-SmaUserPermissions -Server https://kace.example.com -Org Default -Credential (Get-Credential) -UserID 1234</dev:code> + <dev:remarks> + <maml:para>Retrieves information about the permissions for a user with ID 1234</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaUserPermissions.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Invoke-SmaScript</command:name> + <command:verb>Invoke</command:verb> + <command:noun>SmaScript</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Runs a specified script agains a list of given machineIDs</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Invoke-SmaScript</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ScriptID</maml:name> + <maml:Description> + <maml:para>The ID of the script you'd like to execute.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>TargetMachineID</maml:name> + <maml:Description> + <maml:para>Specifies the machine ids to target. Multiples should be comma-seperated.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> + <dev:type> + <maml:name>Array</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ScriptID</maml:name> + <maml:Description> + <maml:para>The ID of the script you'd like to execute.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>TargetMachineID</maml:name> + <maml:Description> + <maml:para>Specifies the machine ids to target. Multiples should be comma-seperated.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> + <dev:type> + <maml:name>Array</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>Int32</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para>output 0=Failure</maml:para> + <maml:para>output non-0 = the given runNow ID</maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>Invoke-SmaScript -ScriptID 1234 -TargetMachineIDs 5678,2345,4567</dev:code> + <dev:remarks> + <maml:para>Runs a script with ID 1234 against machines with IDs 5678,2345,4567</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Invoke-SmaScript.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>New-SmaAsset</command:name> + <command:verb>New</command:verb> + <command:noun>SmaAsset</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Creates a new SMA asset.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>New-SmaAsset</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>A hashtable-formatted payload containing the asset information. See example.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>A hashtable-formatted payload containing the asset information. See example.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>PS> $NewAgentAsset = @{ + 'Assets' =@( + @{ + 'name'='x2test' + "asset_type_id" = 5 + 'location_id' = 1 + 'asset_type_name' = "Computer with Dell Agent" + } + ) +} + +PS> New-SmaAsset -Body $NewAgentAsset</dev:code> + <dev:remarks> + <maml:para>Creates a new SMA asset or type 'Computer with Dell Agent'.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/New-SmaAsset.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>New-SmaScriptTask</command:name> + <command:verb>New</command:verb> + <command:noun>SmaScriptTask</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Creates a new script task for a given script ID. Works with online and offline kscripts.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>New-SmaScriptTask</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ScriptID</maml:name> + <maml:Description> + <maml:para>The ID of the script who's tasks you'd like information about.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>A hashtable-formatted payload with instructions for the task to create.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>A hashtable-formatted payload with instructions for the task to create.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>ScriptID</maml:name> + <maml:Description> + <maml:para>The ID of the script who's tasks you'd like information about.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>$taskparams = @{ +'attempts' = 2 + 'onFailure' = 'break' + 'onRemediationFailure' = @( + @{ + 'id'= 27 # status ID + 'params'= [ordered]@{ + 'type'='status' + 'message'='this is a test message' + } + } + ) +} + +New-SmaScriptTask -ScriptID 1234 -Body $taskparams</dev:code> + <dev:remarks> + <maml:para>Creates a new task for script ID 1234, gives it 2 attempts with a break on failure. On remediation failure, it logs a status message.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/New-SmaScriptTask.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>New-SmaServiceDeskTicket</command:name> + <command:verb>New</command:verb> + <command:noun>SmaServiceDeskTicket</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Creates a new SMA service desk ticket.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>New-SmaServiceDeskTicket</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>A hashtable-formatted payload containing the ticket information. See example.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>A hashtable-formatted payload containing the ticket information. See example.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>PS> $NewTicket = @{ + 'Tickets' =@( + @{ + 'title' = 'test-ticket' + 'hd_queue_id' = 7 # queue ID + 'submitter' = 10 # submitter ID + 'category' = 1 # category ID + "custom_1" = 'my_custom_text' + } + ) +} + +PS> New-SmaTicket -Body $NewTicket</dev:code> + <dev:remarks> + <maml:para>Creates a new SMA ticket for a user with ID of 1234</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/New-SmaServiceDeskTicket.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Remove-SmaServiceDeskTicket</command:name> + <command:verb>Remove</command:verb> + <command:noun>SmaServiceDeskTicket</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Deletes a service desk ticket.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Remove-SmaServiceDeskTicket</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>TicketID</maml:name> + <maml:Description> + <maml:para>The ID of the ticket you want to update</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>TicketID</maml:name> + <maml:Description> + <maml:para>The ID of the ticket you want to update</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>PS> Remove-SmaServiceDeskTicket -TicketID 1234</dev:code> + <dev:remarks> + <maml:para>Deletes a ticket with ID 1234</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Remove-SmaServiceDeskTicket.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Set-SmaAsset</command:name> + <command:verb>Set</command:verb> + <command:noun>SmaAsset</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Updates an SMA asset.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Set-SmaAsset</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>AssetID</maml:name> + <maml:Description> + <maml:para>Specifies the asset ID to update.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>A hashtable-formatted payload containing the asset information. See example.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>AssetID</maml:name> + <maml:Description> + <maml:para>Specifies the asset ID to update.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>A hashtable-formatted payload containing the asset information. See example.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>PS> $SetAssetBody = @{ + 'Assets' = @( + @{ + 'id' = 10000 + 'field_10000' = 'My String' + } + ) +} + +PS> Set-SmaAsset -Body $SetAssetBody</dev:code> + <dev:remarks> + <maml:para>Updates the field 'field_10000' with string 'My String' on asset with ID 1234. Get asset field identities using Get-SmaAsset with query parameters `"?shaping=asset all"` on a similar asset if needed.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Set-SmaAsset.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Set-SmaAssetAsArchived</command:name> + <command:verb>Set</command:verb> + <command:noun>SmaAssetAsArchived</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Archives an existing SMA asset.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Set-SmaAssetAsArchived</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>AssetID</maml:name> + <maml:Description> + <maml:para>The ID of the asset you want to archive.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>A hashtable-formatted payload containing the asset information. See example.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>AssetID</maml:name> + <maml:Description> + <maml:para>The ID of the asset you want to archive.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> + <dev:type> + <maml:name>Int32</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>0</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>A hashtable-formatted payload containing the asset information. See example.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>PS> $Body = @{ + @{ + archiveReason = "Testing Archival via API" + } +} + +PS> Set-SmaAssetAsArchived -AssetID 1234 -Body $Body</dev:code> + <dev:remarks> + <maml:para>Archives an asset with ID 1234 with the reason "Testing Archival via API"</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Set-SmaAssetAsArchived.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Set-SmaMachineInventory</command:name> + <command:verb>Set</command:verb> + <command:noun>SmaMachineInventory</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Updates the inventory information for a device.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Set-SmaMachineInventory</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>MachineID</maml:name> + <maml:Description> + <maml:para>The machine whose information you want to update.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>The payload of the update, in hashtable format.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>The payload of the update, in hashtable format.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>MachineID</maml:name> + <maml:Description> + <maml:para>The machine whose information you want to update.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- Example 1 --------------------------</maml:title> + <dev:code>PS> $Body = @{ + 'Machines' = @( + @{ + 'id' = 1234 + 'notes' = ((Get-Date).tostring()) + + } + ) +} + +PS> Set-SmaMachineInventory -MachineID 1234</dev:code> + <dev:remarks> + <maml:para>Updates the notes field for machine ID 1234. Specified ID in body must match `-MachineID` parameter.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Set-SmaMachineInventory.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> + <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> + <command:details> + <command:name>Set-SmaServiceDeskTicket</command:name> + <command:verb>Set</command:verb> + <command:noun>SmaServiceDeskTicket</command:noun> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:details> + <maml:description> + <maml:para>Updates a ticket.</maml:para> + </maml:description> + <command:syntax> + <command:syntaxItem> + <maml:name>Set-SmaServiceDeskTicket</maml:name> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>TicketID</maml:name> + <maml:Description> + <maml:para>Specifies the ticket id to update</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>The payload of the update, in hashtable format. See example.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:syntaxItem> + </command:syntax> + <command:parameters> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> + <maml:name>Body</maml:name> + <maml:Description> + <maml:para>The payload of the update, in hashtable format. See example.</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> + <dev:type> + <maml:name>Hashtable</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:Description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> + <maml:name>TicketID</maml:name> + <maml:Description> + <maml:para>Specifies the ticket id to update</maml:para> + </maml:Description> + <command:parameterValue required="true" variableLength="false">String</command:parameterValue> + <dev:type> + <maml:name>String</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>None</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:Description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:Description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + </command:parameters> + <command:inputTypes /> + <command:returnValues> + <command:returnValue> + <dev:type> + <maml:name>PSCustomObject</maml:name> + </dev:type> + <maml:description> + <maml:para></maml:para> + </maml:description> + </command:returnValue> + </command:returnValues> + <maml:alertSet> + <maml:alert> + <maml:para></maml:para> + </maml:alert> + </maml:alertSet> + <command:examples> + <command:example> + <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> + <dev:code>PS> $processedBody = @{ + 'Tickets' = @( + @{ + status = 1 # status ID + 'custom_14' = "my value for custom_14" + 'resolution' = "my resolution" + } + ) +} + +PS> Set-SmaServiceDeskTicket -TicketID 1234 -Body $TicketUpdate</dev:code> + <dev:remarks> + <maml:para>Updates a ticket with ID 1234 with the information provided by the $body.</maml:para> + </dev:remarks> + </command:example> + </command:examples> + <command:relatedLinks> + <maml:navigationLink> + <maml:linkText>Online Version:</maml:linkText> + <maml:uri>https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Set-SmaServiceDeskTicket.md</maml:uri> + </maml:navigationLink> + </command:relatedLinks> + </command:command> +</helpItems> \ No newline at end of file diff --git a/private/New-ApiDELETERequest.ps1 b/private/New-ApiDELETERequest.ps1 index eb7771e..cae6fff 100644 --- a/private/New-ApiDELETERequest.ps1 +++ b/private/New-ApiDELETERequest.ps1 @@ -1,69 +1,20 @@ Function New-ApiDELETERequest { param ( [Parameter(Mandatory)] - [ValidateScript({ - If ($_ -notmatch "^(http|https)://") { - Throw 'Must start with "http://" or "https://"' - } Else{ $true }} - )] [String] - $Server, - - [Parameter(Mandatory)] - [String] - $Org, - - [Parameter(Mandatory)] - [String] - $Endpoint, - - [Parameter(Mandatory)] - [PSCredential] - $Credential - + $Endpoint ) - $Auth = @{ - 'password' = ($Credential.GetNetworkCredential().password) - 'userName' = ($Credential.username) - 'organizationName' = $Org - } | ConvertTo-Json - - - # Dynamically find and include all available protocols 'Tls12' or higher. - # Module requires PS 5.1+ so no error checking should be required. - $CurrentVersionTls = [Net.ServicePointManager]::SecurityProtocol Set-ClientTlsProtocols -ErrorAction Stop - $Uri = "$Server/ams/shared/api/security/login" - $Session = New-Object Microsoft.Powershell.Commands.Webrequestsession - - $Headers = @{} - $headers.Add('Accept', 'application/json') - $headers.Add('Content-Type', 'application/json') - $headers.Add('x-dell-api-version', '8') - - $RequestSplat = @{ - Uri = $Uri - Headers = $Headers - Body = $Auth - Method = 'POST' - WebSession = $Session - UseBasicParsing = $True - } - $Request = Invoke-WebRequest @RequestSplat - - $CSRFToken = $Request.Headers.'x-dell-csrf-token' - $headers.Add("x-dell-csrf-token", "$CSRFToken") - - $APIUrl = "{0}{1}" -f $Server,$Endpoint + $APIUrl = "{0}{1}" -f $script:Server, $Endpoint $IRMSplat = @{ - Uri = $APIUrl - Headers = $Headers - Method = 'DELETE' - WebSession = $session + Uri = $APIUrl + Headers = $script:Headers + Method = 'DELETE' + WebSession = $script:Session UseBasicParsing = $true } Invoke-RestMethod @IRMSplat diff --git a/private/New-ApiGETRequest.ps1 b/private/New-ApiGETRequest.ps1 index 89b7dd5..69e4613 100644 --- a/private/New-ApiGETRequest.ps1 +++ b/private/New-ApiGETRequest.ps1 @@ -1,80 +1,33 @@ Function New-ApiGETRequest { <# .DESCRIPTION - Performs an authentication request, then a GET request to the provided endpoint. + Performs an authenticated request to the specified endpoint with (optional) parameters #> [cmdletBinding()] param ( - [Parameter(Mandatory)] - [ValidateScript({ - If ($_ -notmatch "^(http|https)://") { - Throw 'Must start with "http://" or "https://"' - } Else{ $true }} - )] - [String] - $Server, - - [Parameter(Mandatory)] - [String] - $Org, [Parameter(Mandatory)] [String] $Endpoint, - [Parameter(Mandatory)] - [PSCredential] - $Credential, - [Parameter()] [String] $QueryParameters ) - $Auth = @{ - 'password' = ($Credential.GetNetworkCredential().password) - 'userName' = ($Credential.username) - 'organizationName' = $Org - } | ConvertTo-Json - - - # Dynamically find and include all available protocols 'Tls12' or higher. - # Module requires PS 5.1+ so no error checking should be required. + If ($QueryParameters) { + $APIUrl = "{0}{1}{2}" -f $script:Server, $Endpoint, $QueryParameters + } + Else { $APIUrl = "{0}{1}" -f $script:Server, $Endpoint } $CurrentVersionTls = [Net.ServicePointManager]::SecurityProtocol Set-ClientTlsProtocols -ErrorAction Stop - $Uri = "$Server/ams/shared/api/security/login" - $Session = New-Object Microsoft.Powershell.Commands.Webrequestsession - - $Headers = @{} - $headers.Add('Accept', 'application/json') - $headers.Add('Content-Type', 'application/json') - $headers.Add('x-dell-api-version', '8') - - $RequestSplat = @{ - Uri = $Uri - Headers = $Headers - Body = $Auth - Method = 'POST' - WebSession = $Session - UseBasicParsing = $True - } - $Request = Invoke-WebRequest @RequestSplat - - $CSRFToken = $Request.Headers.'x-dell-csrf-token' - $headers.Add("x-dell-csrf-token", "$CSRFToken") - - If ($QueryParameters) { - $APIUrl = "{0}{1}{2}" -f $Server,$Endpoint,$QueryParameters - } - Else { $APIUrl = "{0}{1}" -f $Server,$Endpoint } - $IRMSplat = @{ Uri = $APIUrl - Headers = $Headers + Headers = $script:Headers Method = 'GET' - WebSession = $Session + WebSession = $script:Session UseBasicParsing = $True } Invoke-RestMethod @IRMSplat diff --git a/private/New-ApiPOSTRequest.ps1 b/private/New-ApiPOSTRequest.ps1 index 2a2ca8d..07c33de 100644 --- a/private/New-ApiPOSTRequest.ps1 +++ b/private/New-ApiPOSTRequest.ps1 @@ -1,26 +1,9 @@ Function New-ApiPOSTRequest { param ( - [Parameter(Mandatory)] - [ValidateScript({ - If ($_ -notmatch "^(http|https)://") { - Throw 'Must start with "http://" or "https://"' - } Else{ $true }} - )] - [String] - $Server, - - [Parameter(Mandatory)] - [String] - $Org, - [Parameter(Mandatory)] [String] $Endpoint, - [Parameter(Mandatory)] - [PSCredential] - $Credential, - [Parameter()] $Body, @@ -29,50 +12,19 @@ Function New-ApiPOSTRequest { $QueryParameters ) - $Auth = @{ - 'password' = ($Credential.GetNetworkCredential().password) - 'userName' = ($Credential.username) - 'organizationName' = $Org - } | ConvertTo-Json - - - # Dynamically find and include all available protocols 'Tls12' or higher. - # Module requires PS 5.1+ so no error checking should be required. - $CurrentVersionTls = [Net.ServicePointManager]::SecurityProtocol Set-ClientTlsProtocols -ErrorAction Stop - $Uri = "$Server/ams/shared/api/security/login" - $session = new-object microsoft.powershell.commands.webrequestsession - - $Headers = @{} - $headers.Add('Accept', 'application/json') - $headers.Add('Content-Type', 'application/json') - $headers.Add('x-dell-api-version', '8') - - $RequestSplat = @{ - Uri = $Uri - Headers = $Headers - Body = $Auth - Method = 'POST' - WebSession = $Session - UseBasicParsing = $True - } - $Request = Invoke-WebRequest @RequestSplat - - $CSRFToken = $Request.Headers.'x-dell-csrf-token' - $Headers.Add("x-dell-csrf-token", "$CSRFToken") - If ($QueryParameters) { - $APIUrl = "{0}{1}{2}" -f $Server,$Endpoint,$QueryParameters + $APIUrl = "{0}{1}{2}" -f $Server, $Endpoint, $QueryParameters } - Else { $APIUrl = "{0}{1}" -f $Server,$Endpoint } + Else { $APIUrl = "{0}{1}" -f $Server, $Endpoint } $IRMSplat = @{ - Uri = $APIUrl - Headers = $Headers - Method = 'POST' - WebSession = $session + Uri = $APIUrl + Headers = $script:Headers + Method = 'POST' + WebSession = $script:Session UseBasicParsing = $true } diff --git a/private/New-ApiPUTRequest.ps1 b/private/New-ApiPUTRequest.ps1 index 86cae30..16ae538 100644 --- a/private/New-ApiPUTRequest.ps1 +++ b/private/New-ApiPUTRequest.ps1 @@ -1,71 +1,23 @@ Function New-ApiPUTRequest { param ( - [Parameter(Mandatory)] - [ValidateScript({ - If ($_ -notmatch "^(http|https)://") { - Throw 'Must start with "http://" or "https://"' - } Else{ $true }} - )] - [String] - $Server, - - [Parameter(Mandatory)] - [String] - $Org, - [Parameter(Mandatory)] [String] $Endpoint, - [Parameter(Mandatory)] - [PSCredential] - $Credential, - [Parameter()] $Body ) - $Auth = @{ - 'password' = ($Credential.GetNetworkCredential().password) - 'userName' = ($Credential.username) - 'organizationName' = $Org - } | ConvertTo-Json - - - # Dynamically find and include all available protocols 'Tls12' or higher. - # Module requires PS 5.1+ so no error checking should be required. + $APIUrl = "{0}{1}" -f $script:Server, $Endpoint $CurrentVersionTls = [Net.ServicePointManager]::SecurityProtocol Set-ClientTlsProtocols -ErrorAction Stop - $Uri = "$Server/ams/shared/api/security/login" - $session = new-object microsoft.powershell.commands.webrequestsession - - $Headers = @{} - $headers.Add('Accept', 'application/json') - $headers.Add('Content-Type', 'application/json') - $headers.Add('x-dell-api-version', '8') - - $RequestSplat = @{ - Uri = $Uri - Headers = $Headers - Body = $Auth - Method = 'POST' - WebSession = $Session - UseBasicParsing = $True - } - $Request = Invoke-WebRequest @RequestSplat - - $CSRFToken = $Request.Headers.'x-dell-csrf-token' - $Headers.Add("x-dell-csrf-token", "$CSRFToken") - - $APIUrl = "{0}{1}" -f $Server,$Endpoint - $IRMSplat = @{ - Uri = $APIUrl - Headers = $Headers - Method = 'PUT' - WebSession = $session + Uri = $APIUrl + Headers = $script:Headers + Method = 'PUT' + WebSession = $script:Session UseBasicParsing = $true } diff --git a/public/Connect-Server.ps1 b/public/Connect-Server.ps1 new file mode 100644 index 0000000..b79da38 --- /dev/null +++ b/public/Connect-Server.ps1 @@ -0,0 +1,92 @@ +Function Connect-Server { + param( + [Parameter(Mandatory,Position = 0)] + [ValidateScript( { + If ($_ -notmatch "^(http|https)://") { + Throw 'Must start with "http://" or "https://"' + } + Else { $true } } + )] + [String] + $Server, + + [Parameter(Mandatory)] + [String] + $Org, + + [Parameter(Mandatory)] + [PSCredential] + $Credential + + ) + + Begin { + $Auth = @{ + 'password' = ($Credential.GetNetworkCredential().password) + 'userName' = ($Credential.username) + 'organizationName' = $Org + } | ConvertTo-Json + + $script:Server = $Server + $script:Org = $Org + + # Dynamically find and include all available protocols 'Tls12' or higher. + # Module requires PS 5.1+ so no error checking should be required. + + $CurrentVersionTls = [Net.ServicePointManager]::SecurityProtocol + Set-ClientTlsProtocols -ErrorAction Stop + + $Uri = "{0}/ams/shared/api/security/login" -f $script:Server + + $script:Session = New-Object Microsoft.PowerShell.Commands.WebRequestSession + + $script:Headers = @{ } + $script:Headers.Add('Accept', 'application/json') + $script:Headers.Add('Content-Type', 'application/json') + $script:Headers.Add('x-dell-api-version', '8') + + $RequestSplat = @{ + Uri = $Uri + Headers = $script:Headers + Body = $Auth + Method = 'POST' + WebSession = $script:Session + UseBasicParsing = $True + ErrorAction = 'Stop' + TimeoutSec = 15 + } + Try { + $Request = Invoke-WebRequest @RequestSplat + } + Catch { + + $writeErrorSplat = @{ + Message = "Could not authenticate to '$server' in org '$org'. Ensure credentials are correct." + Category = 'AuthenticationError' + } + Write-Error @writeErrorSplat + + break; + } + + $script:CSRFToken = $Request.Headers.'x-dell-csrf-token' + $script:Headers.Add("x-dell-csrf-token", "$script:CSRFToken") + + # If we received a token, we're authenticated + If ($script:CSRFToken) { + [PSCustomObject]@{ + Server = $script:Server -replace 'https://', '' + Org = $Org + Protocol = if ($Server -match "^(https)://") { 'HTTPS' }else { 'HTTP' } + User = $Credential.username + } + } + Else { + Write-Error "A token from '$Server' could not be retrieved." + } + } + End { + # Be nice and set session security protocols back to how we found them. + [Net.ServicePointManager]::SecurityProtocol = $currentVersionTls + } +} \ No newline at end of file diff --git a/public/asset/Get-ArchiveAsset.ps1 b/public/asset/Get-ArchiveAsset.ps1 index b0656e5..e186434 100644 --- a/public/asset/Get-ArchiveAsset.ps1 +++ b/public/asset/Get-ArchiveAsset.ps1 @@ -1,68 +1,37 @@ Function Get-ArchiveAsset { - <# - .DESCRIPTION - Returns information about an SMA archived asset. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER AssetID - The ID of the archived asset you want to retrieve. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaArchivedAsset -Server https://kace.example.com -Org Default -Credential (Get-Credential) -AssetID 1234 - - Retrieves information about an archived asset with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('AssetId')] [int] - $AssetID, + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { - $Endpoint = "/api/asset/archived_devices/$AssetID" - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + $Endpoint = "/api/asset/archived_devices/{0}" -f $Id + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Assets + } } \ No newline at end of file diff --git a/public/asset/Get-Asset.ps1 b/public/asset/Get-Asset.ps1 index ab6e20f..d78aaff 100644 --- a/public/asset/Get-Asset.ps1 +++ b/public/asset/Get-Asset.ps1 @@ -1,68 +1,17 @@ Function Get-Asset { - <# - .DESCRIPTION - Returns information about an SMA asset. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER AssetID - (Optional) Use if you want to return a specific asset from the SMA. - ID can be found in SMA Admin > Asset Management, then hover over an asset and look at the ID= in the url. - This parameter is required if using the -AsBarcodes switch. - - .PARAMETER AsBarcodes - (Optional) A switch where, if included, will return all barcodes associated with a specified asset (-AssetID parameter). - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaAsset -Server https://kace.example.com -Org Default -Credential (Get-Credential) -AssetID 1234 - - Retrieves information about an asset with ID 1234. - - .EXAMPLE - Get-SmaAsset -Server https://kace.example.com -Org Default -Credential (Get-Credential) -AssetID 5678 -AsBarcodes - - Retrieves barcode information about an asset with ID 5678. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('AssetId')] [int] - $AssetID, + $Id, [Parameter()] [switch] @@ -73,19 +22,25 @@ Function Get-Asset { [string] $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = '/api/asset/assets' - If ($AssetID) { - $Endpoint = "/api/asset/assets/$AssetID" + If ($Id) { + $Endpoint = "/api/asset/assets/{0}" -f $Id If ($AsBarcodes) { - $Endpoint = "/api/asset/assets/$AssetID/barcodes" + $Endpoint = "/api/asset/assets/{0}/barcodes" -f $Id } } - } - Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Assets + } } \ No newline at end of file diff --git a/public/asset/Get-AssetType.ps1 b/public/asset/Get-AssetType.ps1 index e07fc50..d696db1 100644 --- a/public/asset/Get-AssetType.ps1 +++ b/public/asset/Get-AssetType.ps1 @@ -1,63 +1,26 @@ Function Get-AssetType { - <# - .DESCRIPTION - Returns information about an SMA asset type. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaAssetType -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves information about all asset types within an org. - - .NOTES - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { - $Endpoint = '/api/asset/assets/types' - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + $Endpoint = '/api/asset/assets/types' + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { } } \ No newline at end of file diff --git a/public/asset/Get-BarcodeAsset.ps1 b/public/asset/Get-BarcodeAsset.ps1 index bdf3045..9f795d9 100644 --- a/public/asset/Get-BarcodeAsset.ps1 +++ b/public/asset/Get-BarcodeAsset.ps1 @@ -1,74 +1,40 @@ Function Get-BarcodeAsset { - <# - .DESCRIPTION - Returns information about an SMA barcode. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER BarcodeID - (Optional) Use if you want to return a specific barcode from the SMA. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaBarcodeAsset -Server https://kace.example.com -Org Default -Credential (Get-Credential) -BarcodeID 1234 - - Retrieves information about a barcode with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('BarcodeId')] [int] - $BarcodeID, + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = '/api/asset/barcodes' - If ($BarcodeID) { - $Endpoint = "/api/asset/barcodes/$BarcodeID" + + If ($Id) { + $Endpoint = "/api/asset/barcodes/{0}" -f $Id } - } - Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Results = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Results.Barcodes + } } \ No newline at end of file diff --git a/public/asset/New-Asset.ps1 b/public/asset/New-Asset.ps1 index daddbdb..d59529f 100644 --- a/public/asset/New-Asset.ps1 +++ b/public/asset/New-Asset.ps1 @@ -1,76 +1,32 @@ Function New-Asset { - <# - .DESCRIPTION - Creates a new SMA asset. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - - .PARAMETER Body - A hashtable-formatted payload containing the asset information. See example. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - $NewAgentAsset = @{ - 'Assets' =@( - @{ - 'name'='x2test' - "asset_type_id" = 5 - 'location_id' = 7080 - 'asset_type_name' = "Computer with Dell Agent" - } - ) - } - - New-SmaAsset -Server https://kace.example.com -Org Default -Credential (Get-Credential) -Body $NewAgentAsset - - Creates a new SMA asset or type 'Computer with Dell Agent'. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline + )] [ValidateNotNullOrEmpty()] [hashtable] $Body ) - Begin { - $Endpoint = '/api/asset/assets' - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"POST $Endpoint")) { - New-ApiPOSTRequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential -Body $Body + $Endpoint = '/api/asset/assets' + + If ($PSCmdlet.ShouldProcess($Server, "POST $Endpoint")) { + $newApiPOSTRequestSplat = @{ + Body = $Body + Endpoint = $Endpoint + } + $Result = New-ApiPOSTRequest @newApiPOSTRequestSplat } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/public/asset/Set-Asset.ps1 b/public/asset/Set-Asset.ps1 index 511eb44..c137424 100644 --- a/public/asset/Set-Asset.ps1 +++ b/public/asset/Set-Asset.ps1 @@ -1,87 +1,39 @@ Function Set-Asset { - <# - .DESCRIPTION - Updates an SMA asset. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - - .PARAMETER Body - A hashtable-formatted payload containing the asset information. See example. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - $SetAssetBody = @{ - 'Assets' = @( - @{ - 'id' = 1234 - 'field_10000' = 'My String' - } - ) - } - - Set-SmaAsset -Server https://kace.example.com -Org Default -Credential (Get-Credential) -Body $SetAssetBody - - Updates the field 'field_10000' with string 'My String' on asset with ID 1234. Get - asset field identities using Get-SmaAsset on a similar asset if needed. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'medium' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('AssetId')] [int] - $AssetID, + $Id, - [Parameter(Mandatory = $true)] + [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [hashtable] $Body ) - Begin { - $Endpoint = "/api/asset/assets/$AssetID" - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"PUT $Endpoint")) { + $Endpoint = "/api/asset/assets/{0}" -f $Id + + If ($PSCmdlet.ShouldProcess($Server, "PUT $Endpoint")) { $InvokeParams = @{ - Server = $Server Endpoint = $Endpoint - Org = $Org - Credential = $Credential - Body = $Body + Body = $Body } - New-ApiPUTRequest @InvokeParams + $Result = New-ApiPUTRequest @InvokeParams } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/public/asset/Set-AssetAsArchived.ps1 b/public/asset/Set-AssetAsArchived.ps1 index 20a10f8..fc63141 100644 --- a/public/asset/Set-AssetAsArchived.ps1 +++ b/public/asset/Set-AssetAsArchived.ps1 @@ -1,73 +1,38 @@ Function Set-AssetAsArchived { - <# - .DESCRIPTION - Archives an existing SMA asset. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - - .PARAMETER AssetID - The ID of the asset you want to archive. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - $Body = @{ - archiveReason = "Testing Archival via API" - } - - Set-SmaAssetAsArchived -Server https://kace.example.com -Org Default -Credential (Get-Credential) -AssetID 1234 -Body $Body - - Archives an asset with ID 1234 with the reason "Testing Archival via API" - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('AssetId')] [int] - $AssetID, + $Id, - [Parameter(Mandatory = $true)] + [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [hashtable] $Body ) - Begin { - $Endpoint = "/api/asset/assets/$AssetID/archive" - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"POST $Endpoint")) { - New-ApiPOSTRequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential -Body $Body + $Endpoint = "/api/asset/assets/{0}/archive" -f $Id + + If ($PSCmdlet.ShouldProcess($Server, "POST $Endpoint")) { + $newApiPOSTRequestSplat = @{ + Body = $Body + Endpoint = $Endpoint + } + $Result = New-ApiPOSTRequest @newApiPOSTRequestSplat } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/public/inventory/Get-AgentlessInventory.ps1 b/public/inventory/Get-AgentlessInventory.ps1 index 9137a12..15ce86f 100644 --- a/public/inventory/Get-AgentlessInventory.ps1 +++ b/public/inventory/Get-AgentlessInventory.ps1 @@ -1,79 +1,41 @@ Function Get-AgentlessInventory { - <# - .DESCRIPTION - Returns information about the SMA agentless inventory, or a specific node. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER NodesID - (Optional) Use if you want to return a specific agentless node from the SMA. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaAgentlessInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves information about all agentless inventory nodes - - .EXAMPLE - Get-SmaAgentlessInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) -NodeID 1234 - - Retrieves node information about an agentless node with with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] + + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('NodesId')] [int] - $NodesID, + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = '/api/inventory/nodes' - If ($NodesID) { - $Endpoint = "/api/inventory/nodes/$NodesID" + If ($ID) { + $Endpoint = "/api/inventory/nodes/{0}" -f $ID } - } - Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } + End { + $Result.Nodes + } } \ No newline at end of file diff --git a/public/inventory/Get-MachineInventory.ps1 b/public/inventory/Get-MachineInventory.ps1 index 92df3b8..16d45a3 100644 --- a/public/inventory/Get-MachineInventory.ps1 +++ b/public/inventory/Get-MachineInventory.ps1 @@ -1,79 +1,41 @@ Function Get-MachineInventory { - <# - .DESCRIPTION - Returns information about the SMA inventory, or a specific device. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER MachineID - (Optional) Use if you want to return a specific machine from the SMA. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaMachineInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves machine information about all inventory devices - - .EXAMPLE - Get-SmaMachineInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) -MachineID 1234 - - Retrieves machine information about an inventory device with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] - [string] - $MachineID, + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('MachineId')] + [int] + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = '/api/inventory/machines' - If ($MachineID) { - $Endpoint = "/api/inventory/machines/$MachineID" + + If ($Id) { + $Endpoint = "/api/inventory/machines/{0}" -f $Id } - } - Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Machines + } } \ No newline at end of file diff --git a/public/inventory/Get-MachineProcess.ps1 b/public/inventory/Get-MachineProcess.ps1 index 535bcac..1096507 100644 --- a/public/inventory/Get-MachineProcess.ps1 +++ b/public/inventory/Get-MachineProcess.ps1 @@ -1,63 +1,17 @@ Function Get-MachineProcess { - <# - .DESCRIPTION - Returns information about the SMA inventory processes, or a specific process. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER ProcessID - (Optional) Use if you want to return a specific process from the SMA. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaMachineProcess -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves machine information about all inventory devices - - .EXAMPLE - Get-SmaMachineProcess -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ProcessID 1234 - - Retrieves inventory process information about a process with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] - [string] - $ProcessID, + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('ProcessId')] + [int] + $Id, [Parameter()] [ValidatePattern("^\?")] @@ -65,19 +19,24 @@ Function Get-MachineProcess { $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = '/api/inventory/processes' - If ($ProcessID) { - $Endpoint = "/api/inventory/processes/$ProcessID" + + If ($Id) { + $Endpoint = "/api/inventory/processes/{0}" -f $Id } - } - Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } End { - + $Result.Processes } } \ No newline at end of file diff --git a/public/inventory/Get-MachineService.ps1 b/public/inventory/Get-MachineService.ps1 index 8865e9e..349ccde 100644 --- a/public/inventory/Get-MachineService.ps1 +++ b/public/inventory/Get-MachineService.ps1 @@ -1,63 +1,17 @@ Function Get-MachineService { - <# - .DESCRIPTION - Returns information about the SMA inventory services, or a specific service. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER ServiceID - (Optional) Use if you want to return a specific service from the SMA. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaMachineService -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves service information about all inventory devices - - .EXAMPLE - Get-SmaMachineService -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ServiceID 1234 - - Retrieves inventory service information about a service with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] - [string] - $ServiceID, + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('ServiceId')] + [int] + $Id, [Parameter()] [ValidatePattern("^\?")] @@ -65,16 +19,22 @@ Function Get-MachineService { $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = '/api/inventory/services' - If ($ServiceID) { - $Endpoint = "/api/inventory/services/$ServiceID" + If ($Id) { + $Endpoint = "/api/inventory/services/{0}" -f $Id } - } - Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Services + } } \ No newline at end of file diff --git a/public/inventory/Get-OperatingSystemInventory.ps1 b/public/inventory/Get-OperatingSystemInventory.ps1 index ce7ef31..77f0ade 100644 --- a/public/inventory/Get-OperatingSystemInventory.ps1 +++ b/public/inventory/Get-OperatingSystemInventory.ps1 @@ -1,79 +1,40 @@ Function Get-OperatingSystemInventory { - <# - .DESCRIPTION - Returns information about operating systems for SMA inventory devices, or for specific inventory device. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER MAchineID - (Optional) Use if you want to return the operating system information about a specific inventory device. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaOperatingSystemInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves information about all inventory devices' operating systems. - - .EXAMPLE - Get-SmaOperatingSystemInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) -MachineID 1234 - - Retrieves operating system information for an inventory device with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] - [string] - $MachineID, + + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('MachineId')] + [int] + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = '/api/inventory/operating_systems' - If ($MachineID) { - $Endpoint = "/api/inventory/operating_systems/$MachineID" + + If ($Id) { + $Endpoint = "/api/inventory/operating_systems/{0}" -f $Id } - } - Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.OperatingSystems + } } \ No newline at end of file diff --git a/public/inventory/Get-SoftwareInventory.ps1 b/public/inventory/Get-SoftwareInventory.ps1 index c8f31cf..6a8921c 100644 --- a/public/inventory/Get-SoftwareInventory.ps1 +++ b/public/inventory/Get-SoftwareInventory.ps1 @@ -1,63 +1,17 @@ Function Get-SoftwareInventory { - <# - .DESCRIPTION - Returns information about SMA software titles, or for specific software title. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER SoftwareID - (Optional) Use if you want to return information about a specific software title. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaSoftwareInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves information about all software titles in the SMA. - - .EXAMPLE - Get-SmaSoftwareInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) -SoftwareID 1234 - - Retrieves information for a software title with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] - [string] - $SoftwareID, + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('SoftwareId')] + [int] + $Id, [Parameter()] [ValidatePattern("^\?")] @@ -65,16 +19,22 @@ Function Get-SoftwareInventory { $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = '/api/inventory/softwares' - If ($SoftwareID) { - $Endpoint = "/api/inventory/softwares/$SoftwareID" + If ($Id) { + $Endpoint = "/api/inventory/softwares/{0}" -f $Id } - } - Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Software + } } \ No newline at end of file diff --git a/public/inventory/Get-StartupProgramInventory.ps1 b/public/inventory/Get-StartupProgramInventory.ps1 index 5e6d835..8670b0e 100644 --- a/public/inventory/Get-StartupProgramInventory.ps1 +++ b/public/inventory/Get-StartupProgramInventory.ps1 @@ -1,63 +1,17 @@ Function Get-StartupProgramInventory { - <# - .DESCRIPTION - Returns information about startup programs from SMA inventory devices, or for specific startup program. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER ProgramID - (Optional) Use if you want to return the information about a specific startup program. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaStartupProgramInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves information about all inventory devices' startup programs. - - .EXAMPLE - Get-SmaStartupProgramInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ProgramID 1234 - - Retrieves information for a startup program with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] - [string] - $ProgramID, + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('ProgramId')] + [int] + $Id, [Parameter()] [ValidatePattern("^\?")] @@ -65,15 +19,23 @@ Function Get-StartupProgramInventory { $QueryParameters ) Begin { - $Endpoint = '/api/inventory/startup_programs' - If ($ProgramID) { - $Endpoint = "/api/inventory/startup_programs/$ProgramID" - } + } Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + $Endpoint = '/api/inventory/startup_programs' + If ($Id) { + $Endpoint = "/api/inventory/startup_programs/{0}" -f $Id } + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat + } + } + End { + $Result.StartupPrograms } - End {} } \ No newline at end of file diff --git a/public/inventory/Set-MachineInventory.ps1 b/public/inventory/Set-MachineInventory.ps1 index b58d5cb..e7eccb7 100644 --- a/public/inventory/Set-MachineInventory.ps1 +++ b/public/inventory/Set-MachineInventory.ps1 @@ -1,69 +1,39 @@ Function Set-MachineInventory { - <# - .DESCRIPTION - Updates the inventory information for a device. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER MachineID - The machine whose information you want to update. - - .PARAMETER Body - The payload of the update, in hashtable format. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'medium' )] param( - [Parameter(Mandatory = $true,Position=0)] - [string] - $MachineID, - - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('MachineId')] + [int] + $Id, + + [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [hashtable] $Body ) - Begin { - $Endpoint = "/api/inventory/machines/$MachineID" - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"PUT $Endpoint")) { - Write-Warning "This cmdlet invokes a client-side inventory check. - Additional info: https://github.com/ArtisanByteCrafter/KaceSMA/wiki/FAQ#q-set-smamachineinventory-triggers-a-client-side-inventory" + $Endpoint = "/api/inventory/machines/{0}" -f $Id + + If ($PSCmdlet.ShouldProcess($Server, "PUT $Endpoint")) { + Write-Warning "This cmdlet invokes a client-side inventory check-in to the appliance." - New-ApiPUTRequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential -Body $Body + $newApiPUTRequestSplat = @{ + Body = $Body + Endpoint = $Endpoint + } + $Result = New-ApiPUTRequest @newApiPUTRequestSplat } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/public/managed_install/Get-ManagedInstall.ps1 b/public/managed_install/Get-ManagedInstall.ps1 index dd14fd8..f8f8f51 100644 --- a/public/managed_install/Get-ManagedInstall.ps1 +++ b/public/managed_install/Get-ManagedInstall.ps1 @@ -1,71 +1,17 @@ Function Get-ManagedInstall { - <# - .DESCRIPTION - Returns information about SMA managed installs. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER ManagedInstallID - (Optional) Use if you want to return the information about a specific managed install. - - .PARAMETER ListCompatibleMachines - (Optional) Use with -ManagedInstallID if you want to return all machines compatible with a specific managed install. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaManagedInstall -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves information about all managed installs. - - .EXAMPLE - Get-SmaManagedInstall -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ManagedInstallID 1234 - - Retrieves information for a managed install with ID 1234. - - .EXAMPLE - Get-SmaManagedInstall -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ManagedInstallID 1234 -ListCompatibleMachines - - Retrieves machines compatible with -managedinstallID 1234 - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('ManagedInstallId')] [int] - $ManagedInstallID, + $Id, [Parameter()] [switch] @@ -78,17 +24,24 @@ Function Get-ManagedInstall { ) Begin { $Endpoint = '/api/managed_install/managed_installs' - If ($ManagedInstallID) { - $Endpoint = "/api/managed_install/managed_installs/$ManagedInstallID" + + If ($Id) { + $Endpoint = "/api/managed_install/managed_installs/{0}" -f $Id If ($ListCompatibleMachines) { - $Endpoint = "/api/managed_install/managed_installs/$ManagedInstallID/compatible_machines" + $Endpoint = "/api/managed_install/managed_installs/{0}/compatible_machines" -f $Id } } } Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.MIs + } } \ No newline at end of file diff --git a/public/managed_install/Get-ManagedInstallMachineCompatibility.ps1 b/public/managed_install/Get-ManagedInstallMachineCompatibility.ps1 index d4e3f50..a79bfc0 100644 --- a/public/managed_install/Get-ManagedInstallMachineCompatibility.ps1 +++ b/public/managed_install/Get-ManagedInstallMachineCompatibility.ps1 @@ -1,71 +1,37 @@ Function Get-ManagedInstallMachineCompatibility { - <# - .DESCRIPTION - Returns managed installs associated with a machine ID. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER MachineID - The ID of the inventory machine you wish to retrieve the managed installs for. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaManagedInstallMachineCompatibility -Server https://kace.example.com -Org Default -Credential (Get-Credential) -MachineID 1234 - - Retrieves managed install information about an inventory device with ID 1234 - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('MachineId')] [int] - $MachineID, + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { - $Endpoint = "/api/managed_install/machines/$MachineID" - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + $Endpoint = "/api/managed_install/machines/{0}" -f $Id + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Machines + } } \ No newline at end of file diff --git a/public/reporting/Get-ReportingDefinition.ps1 b/public/reporting/Get-ReportingDefinition.ps1 index 55993af..b76398a 100644 --- a/public/reporting/Get-ReportingDefinition.ps1 +++ b/public/reporting/Get-ReportingDefinition.ps1 @@ -1,96 +1,65 @@ Function Get-ReportingDefinition { - <# - .DESCRIPTION - //todo - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER DefinitionID - //todo - .PARAMETER DefinitionName - //todo - .PARAMETER DistinctField - //todo - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - This will return the reporting definitions for report ID 1234 in ORG 1. - - Get-SmaReportingDefinition -Server https://kace.example.com -Credential (Get-Credential) -DefinitionID 1234 -QueryParameters "?orgID=1" - - .EXAMPLE - //todo - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low', - DefaultParameterSetName = "DefinitionID" + DefaultParameterSetName = "Id" )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(ParameterSetName='A')] + [Parameter( + Position = 0, + ParameterSetName = 'A', + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('DefinitionId')] [int] - $DefinitionID, + $Id, - [Parameter(ParameterSetName='B')] + [Parameter( + ParameterSetName = 'B', + Position = 0, + ValueFromPipelineByPropertyName + )] + [Alias('DefinitionName')] [string] - $DefinitionName, + $Name, - [Parameter(ParameterSetName='C')] + [Parameter( + ParameterSetName = 'C', + Position = 0, + ValueFromPipelineByPropertyName + )] + [Alias('DefinitionField')] [string] - $DistinctField, + $Field, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = '/api/reporting/definitions' - If ($DefinitionID) { - $Endpoint = "/api/reporting/definitions/$DefinitionID" + If ($Id) { + $Endpoint = "/api/reporting/definitions/{0}" -f $Id } - If ($DefinitionName) { - $Endpoint = "/api/reporting/definitions/$DefinitionName" + If ($Name) { + $Endpoint = "/api/reporting/definitions/{0}" -f $Name } - If ($DistinctField) { - $Endpoint = "/api/reporting/definitions/$DistinctField" + If ($Field) { + $Endpoint = "/api/reporting/definitions/{0}" -f $Field } - } - Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Definitions + } } \ No newline at end of file diff --git a/public/scripts/Get-Script.ps1 b/public/scripts/Get-Script.ps1 index d2c923a..0b11cf6 100644 --- a/public/scripts/Get-Script.ps1 +++ b/public/scripts/Get-Script.ps1 @@ -1,78 +1,39 @@ Function Get-Script { - <# - .DESCRIPTION - Returns information about a specific script. - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER ScriptID - (Optional) If used, this is the ID of the script you'd like information about. If not provided, all scripts are returned - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaScript -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves information about all scripts in the org. - - .EXAMPLE - Get-SmaScript -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ScriptID 1234 - - Retrieves information about a script with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('ScriptId')] [int] - $ScriptID, + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = "/api/scripts" - If ($ScriptID) { - $Endpoint = "/api/script/$ScriptID" + If ($Id) { + $Endpoint = "/api/script/{0}" -f $Id } - } - Process { + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/public/scripts/Get-ScriptDependency.ps1 b/public/scripts/Get-ScriptDependency.ps1 index d6b38a4..00c01d2 100644 --- a/public/scripts/Get-ScriptDependency.ps1 +++ b/public/scripts/Get-ScriptDependency.ps1 @@ -1,73 +1,34 @@ Function Get-ScriptDependency { - <# - .DESCRIPTION - Returns information about dependencies for a specific script. - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER ScriptID - The ID of the script whose dependencies you want to retrieve. - - .PARAMETER DependencyName - (Optional) The ID of the dependency for a specific script you want to retrieve. If omitted, will return all dependencies - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaScriptDependency -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ScriptID 1234 - - Retrieves information about the dependencies for a script with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('ScriptId')] [int] - $ScriptID, + $Id, [Parameter()] [string] $DependencyName ) - Begin { - $Endpoint = "/api/script/$ScriptID/dependencies" + Begin { } + Process { + $Endpoint = "/api/script/{0}/dependencies" -f $Id + If ($DependencyName) { - $Endpoint = "/api/script/$ScriptID/dependency/$DependencyName" + $Endpoint = "/api/script/{0}/dependency/{1}" -f $Id, $DependencyName } - } - Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + New-ApiGETRequest -Endpoint $Endpoint } } - End {} + End { } } \ No newline at end of file diff --git a/public/scripts/Get-ScriptRunStatus.ps1 b/public/scripts/Get-ScriptRunStatus.ps1 index a7f0a68..02f6ad9 100644 --- a/public/scripts/Get-ScriptRunStatus.ps1 +++ b/public/scripts/Get-ScriptRunStatus.ps1 @@ -1,64 +1,28 @@ Function Get-ScriptRunStatus { - <# - .DESCRIPTION - Returns information about the status of a running script using the runID. Equivalent to the 'Run Now Status' in the SMA admin page. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER RunID - The ID of the job who's run status you want to return. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaScriptRunStatus -Server https://kace.example.com -Org Default -Credential (Get-Credential) -RunID 1234 - - Retrieves the runStatus of job with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('RunId')] [int] - $RunID + $Id ) - Begin { - $Endpoint = "/api/script/runStatus/$RunID" - - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential + $Endpoint = "/api/script/runStatus/{0}" -f $Id + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $Result = New-ApiGETRequest -Endpoint $Endpoint } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/public/scripts/Get-ScriptTask.ps1 b/public/scripts/Get-ScriptTask.ps1 index 93d0e3d..962365a 100644 --- a/public/scripts/Get-ScriptTask.ps1 +++ b/public/scripts/Get-ScriptTask.ps1 @@ -1,75 +1,41 @@ Function Get-ScriptTask { - <# - .DESCRIPTION - Returns task information about a specific script. - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER ScriptID - The ID of the script who's tasks you'd like information about. - - .PARAMETER OrderID - (Optional) The order (ordinal) ID of a specific task to be returned. - The first task in a script is ordinal ID 0, and increments from there. - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaScriptTask -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ScriptID 1234 - - Retrieves task information about a script with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('ScriptId')] [int] - $ScriptID, - - [Parameter()] + $Id, + + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('OrderId')] [int] - $OrderID + $OrdinalID ) - Begin { - $Endpoint = "/api/script/$ScriptID/tasks" - If ($OrderID) { - $Endpoint = "/api/script/$ScriptID/task/$OrderID" - } - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential + $Endpoint = "/api/script/{0}/tasks" -f $Id + + If ($OrdinalID) { + $Endpoint = "/api/script/{0}/task/{1}" -f $Id, $OrdinalID + } + + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { + $Result = New-ApiGETRequest -Endpoint $Endpoint } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/public/scripts/Invoke-Script.ps1 b/public/scripts/Invoke-Script.ps1 index 7d56a2d..98cb562 100644 --- a/public/scripts/Invoke-Script.ps1 +++ b/public/scripts/Invoke-Script.ps1 @@ -1,77 +1,45 @@ Function Invoke-Script { - <# - .DESCRIPTION - Runs a specified script agains a list of given machineIDs - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER ScriptID - The ID of the script you'd like to execute. - - .PARAMETER TargetMachineIDs - An array, or comma seperated list of machine IDs to execute the script against. - Both @(1,2,3,4) and 1,2,3,4 are valid. - - .INPUTS - - .OUTPUTS - Integer - - 0=Failure - non 0 = runNow ID - - .EXAMPLE - Invoke-SmaScript -Server 'https://kace.example.com' -Credential (Get-Credential) -ScriptID 1234 -TargetMachineIDs 5678,2345,4567 - - Runs a script with ID 1234 against machines with IDs 5678,2345,4567 - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'medium' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('ScriptId')] [int] - $ScriptID, + $Id, - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 1 + )] [ValidateNotNullOrEmpty()] [array] - $TargetMachineIDs + $TargetMachineID ) - Begin { - $Endpoint = "/api/script/$ScriptID/actions/run" - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"POST $Endpoint")) { - $Machines = $TargetMachineIDs -join ',' - New-ApiPOSTRequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential -QueryParameters "?machineIDs=$Machines" + $Endpoint = "/api/script/{0}/actions/run" -f $Id + $Machines = $TargetMachineID -join ',' + + If ($PSCmdlet.ShouldProcess($Server, "POST $Endpoint")) { + + $newApiPOSTRequestSplat = @{ + QueryParameters = "?machineIDs={0}" -f $Machines + Endpoint = $Endpoint + } + $Result = New-ApiPOSTRequest @newApiPOSTRequestSplat + } + } + End { + [PSCustomObject]@{ + RunId = $Result } } - End {} } \ No newline at end of file diff --git a/public/scripts/New-Script.ps1 b/public/scripts/New-Script.ps1 index e462b64..0357cff 100644 --- a/public/scripts/New-Script.ps1 +++ b/public/scripts/New-Script.ps1 @@ -1,63 +1,10 @@ Function New-Script { - <# - .DESCRIPTION - Creates a new script. The -Body payload parameters determine what type of script is created. - Types of script include online/offline kscript and online/offline shell script. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER Body - A hashtable-formatted payload with parameters for the new script. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - $scriptparams = @{ - 'name' = 'xMy New Script' - 'description' = 'This script is amazing.' - 'enabled' = $False - 'status' = 'Draft' - 'notes'='These are the notes' - 'scheduleType'='online-kscript' - 'alertEnabled' = $False - } - New-SmaScript -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ScriptID 1234 -Body $scriptparams - - Creates a new script with the given parameters. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'medium' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [hashtable] $Body @@ -67,9 +14,13 @@ Function New-Script { $Endpoint = "/api/script" # Not Working yet, so not exposed } Process { - If ($PSCmdlet.ShouldProcess($Server,"POST $Endpoint")) { - New-ApiPOSTRequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential -Body $Body + If ($PSCmdlet.ShouldProcess($Server, "POST $Endpoint")) { + $newApiPOSTRequestSplat = @{ + Body = $Body + Endpoint = $Endpoint + } + New-ApiPOSTRequest @newApiPOSTRequestSplat } } - End {} + End { } } \ No newline at end of file diff --git a/public/scripts/New-ScriptTask.ps1 b/public/scripts/New-ScriptTask.ps1 index 7cd4c50..01b3a95 100644 --- a/public/scripts/New-ScriptTask.ps1 +++ b/public/scripts/New-ScriptTask.ps1 @@ -1,86 +1,40 @@ Function New-ScriptTask { - <# - .DESCRIPTION - Creates a new script task for a given script ID. Works with online and offline kscripts. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER ScriptID - The ID of the script who's tasks you'd like information about. - - .PARAMETER Body - A hashtable-formatted payload with instructions for the task to create. - - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - $taskparams = @{ - 'attempts' = 2 - 'onFailure' = 'break' - 'onRemediationFailure' = @( - @{ - 'id'= 27 - 'params'= [ordered]@{ - 'type'='status' - 'message'='this is a test message' - } - } - ) - } - New-SmaScriptTask -Server https://kace.example.com -Org Default -Credential (Get-Credential) -ScriptID 1234 -Body $taskparams - - Creates a new task for script ID 1234, gives it 2 attempts with a break on failure. On remediation failure, it logs a status message. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'medium' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('ScriptId')] [int] - $ScriptID, + $Id, - [Parameter(Mandatory = $true)] + [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [hashtable] $Body ) Begin { - $Endpoint = "/api/script/$ScriptID/task" + } Process { - If ($PSCmdlet.ShouldProcess($Server,"POST $Endpoint")) { - New-ApiPOSTRequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential -Body $Body + $Endpoint = "/api/script/{0}/task" -f $Id + + If ($PSCmdlet.ShouldProcess($Server, "POST $Endpoint")) { + $newApiPOSTRequestSplat = @{ + Body = $Body + Endpoint = $Endpoint + } + $Result = New-ApiPOSTRequest @newApiPOSTRequestSplat } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/public/service_desk/Get-ServiceDeskQueue.ps1 b/public/service_desk/Get-ServiceDeskQueue.ps1 index f27314b..74b1ce0 100644 --- a/public/service_desk/Get-ServiceDeskQueue.ps1 +++ b/public/service_desk/Get-ServiceDeskQueue.ps1 @@ -1,78 +1,40 @@ Function Get-ServiceDeskQueue { - <# - .DESCRIPTION - Returns information about service desk queues. - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER QueueID - (Optional) If used, this is the ID of the queue you'd like information about. If not provided, all queues are returned - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaServiceDeskQueues -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves information about all queues in the org. - - .EXAMPLE - Get-SmaServiceDeskQueues -Server https://kace.example.com -Org Default -Credential (Get-Credential) -QueueID 1234 - - Retrieves information about a queue with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('QueueId')] [int] - $QueueID, + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = "/api/service_desk/queues" - If ($QueueID) { - $Endpoint = "/api/service_desk/queues/$QueueID" + + If ($Id) { + $Endpoint = "/api/service_desk/queues/{0}" -f $Id } - } - Process { + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Queues + } } \ No newline at end of file diff --git a/public/service_desk/Get-ServiceDeskQueueField.ps1 b/public/service_desk/Get-ServiceDeskQueueField.ps1 index 21160ae..4e7e64b 100644 --- a/public/service_desk/Get-ServiceDeskQueueField.ps1 +++ b/public/service_desk/Get-ServiceDeskQueueField.ps1 @@ -1,71 +1,37 @@ Function Get-ServiceDeskQueueField { - <# - .DESCRIPTION - Returns a list of all a queue’s fields. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER QueueID - The ID of the queue who's fields you'd like information about. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaServiceDeskQueueField -Server https://kace.example.com -Org Default -Credential (Get-Credential) -QueueID 1234 - - Retrieves field information about a queue with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter()] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('QueueId')] [int] - $QueueID, + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { - $Endpoint = "/api/service_desk/queues/$QueueID/fields" - } + Begin { } Process { + $Endpoint = "/api/service_desk/queues/{0}/fields" -f $Id + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Fields + } } \ No newline at end of file diff --git a/public/service_desk/Get-ServiceDeskTicket.ps1 b/public/service_desk/Get-ServiceDeskTicket.ps1 index 6f4749d..47163ff 100644 --- a/public/service_desk/Get-ServiceDeskTicket.ps1 +++ b/public/service_desk/Get-ServiceDeskTicket.ps1 @@ -1,83 +1,39 @@ Function Get-ServiceDeskTicket { - <# - .DESCRIPTION - Returns a list of all tickets. Sub-entities that can be used on shaping and filtering directives include owner, - submitter, queue, category, priority, status, machine, asset, related_tickets, referring_tickets - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - $queryparameters = "?BY_STATE_TICKETS=all_notclosed&QUEUE_ID=0" - - Get-SmaServiceDeskTicket -Server https://kace.example.com -Org Default -Credential (Get-Credential) -QueryParameters $queryparameters - - Retrieves all "not closed" state tickets from all queues (ID=0) - - .EXAMPLE - - $queryparameters = "?shaping= hd_ticket regular,owner limited,submitter limited" - - Get-SmaServiceDeskTicket -Server $server -Credential $credentials -ticketID 1234 -QueryParameters $queryparameters - - Retrieves the standard attributes, plus owner and submitter for ticket ID 1234 - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - + [Parameter( + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('TicketId')] [int] - $TicketID, + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { + Begin { } + Process { $Endpoint = "/api/service_desk/tickets" - If ($TicketID){ - $Endpoint = "/api/service_desk/tickets/$TicketID" + If ($Id) { + $Endpoint = "/api/service_desk/tickets/{0}" -f $Id } - - } - Process { + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Tickets + } } \ No newline at end of file diff --git a/public/service_desk/Get-ServiceDeskTicketChanges.ps1 b/public/service_desk/Get-ServiceDeskTicketChanges.ps1 index 96f910f..79a2fff 100644 --- a/public/service_desk/Get-ServiceDeskTicketChanges.ps1 +++ b/public/service_desk/Get-ServiceDeskTicketChanges.ps1 @@ -1,68 +1,37 @@ Function Get-ServiceDeskTicketChanges { - <# - .DESCRIPTION - Returns a list of all ticket changes to a given ticket. - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - - Get-SmaServiceDeskTicketChanges -Server $server -Credential $credentials -ticketID 1234 -QueryParameters $queryparameters - - Retrieves the ticket changes for ticket 1234 - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('TicketId')] [int] - $TicketID, + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { - $Endpoint = "/api/service_desk/tickets/$TicketID/changes" - } + Begin { } Process { + $Endpoint = "/api/service_desk/tickets/{0}/changes" -f $Id + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Changes + } } \ No newline at end of file diff --git a/public/service_desk/Get-ServiceDeskTicketTemplate.ps1 b/public/service_desk/Get-ServiceDeskTicketTemplate.ps1 index 960e492..4a70798 100644 --- a/public/service_desk/Get-ServiceDeskTicketTemplate.ps1 +++ b/public/service_desk/Get-ServiceDeskTicketTemplate.ps1 @@ -1,72 +1,37 @@ Function Get-ServiceDeskTicketTemplate { - <# - .DESCRIPTION - Returns a ticket template for the specified queue, usable for ticket creation. - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER QueueID - The ID of the queue who's ticket templates you'd like information about. - - .PARAMETER QueryParameters - (Optional) Any additional query parameters to be included. String must begin with a <?> character. - - .INPUTS - - .OUTPUTS - PSCustomObject - - - .EXAMPLE - Get-SmaServiceDeskTicketTemplate -Server https://kace.example.com -Org Default -Credential (Get-Credential) -QueueID 1234 - - Retrieves information about a queue with ID 1234. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('QueueId')] [int] - $QueueID, + $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) - Begin { - $Endpoint = "/api/service_desk/queues/$QueueID/ticket_template" - - } + Begin { } Process { + $Endpoint = "/api/service_desk/queues/{0}/ticket_template" -f $Id + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result.Tickets + } } \ No newline at end of file diff --git a/public/service_desk/New-ServiceDeskTicket.ps1 b/public/service_desk/New-ServiceDeskTicket.ps1 index f84ff09..a57bed0 100644 --- a/public/service_desk/New-ServiceDeskTicket.ps1 +++ b/public/service_desk/New-ServiceDeskTicket.ps1 @@ -1,76 +1,31 @@ Function New-ServiceDeskTicket { - <# - .DESCRIPTION - Creates a new SMA service desk ticket. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - - .PARAMETER Body - A hashtable-formatted payload containing the ticket information. See example. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - $NewTicket = @{ - 'Tickets' =@( - @{ - 'title'='test-ticket' - 'hu_queue_id= 1 - 'submitter' = 1234 - "custom_1" = 'custom field 1 text' - } - ) - } - - New-SmaTicket -Server https://kace.example.com -Org Default -Credential (Get-Credential) -Body $NewTicket - - Creates a new SMA ticket for a user with ID of 1234 - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline + )] [ValidateNotNullOrEmpty()] [hashtable] $Body ) - Begin { - $Endpoint = '/api/service_desk/tickets' - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"POST $Endpoint")) { - New-ApiPOSTRequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential -Body $Body + $Endpoint = '/api/service_desk/tickets' + + If ($PSCmdlet.ShouldProcess($Server, "POST $Endpoint")) { + $newApiPOSTRequestSplat = @{ + Body = $Body + Endpoint = $Endpoint + } + $Result = New-ApiPOSTRequest @newApiPOSTRequestSplat } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/public/service_desk/Remove-ServiceDeskTicket.ps1 b/public/service_desk/Remove-ServiceDeskTicket.ps1 index e9544d0..01e8fae 100644 --- a/public/service_desk/Remove-ServiceDeskTicket.ps1 +++ b/public/service_desk/Remove-ServiceDeskTicket.ps1 @@ -1,66 +1,29 @@ Function Remove-ServiceDeskTicket { - <# - .DESCRIPTION - Deletes a service desk ticket. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER TicketID - The ID of the ticket you want to update - - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - - - Remove-SmaServiceDeskTicket -Server https://kace.example.com -Org Default -Credential (Get-Credential) -TicketID 1234 - - Deletes a ticket with ID 1234 - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'high' )] param( - [Parameter(Mandatory = $true,Position=0)] - [string] - $TicketID, - - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('TicketId')] + [int] + $Id - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential ) - Begin { - $Endpoint = "/api/service_desk/tickets/$TicketID" - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"DELETE $Endpoint")) { - New-ApiDELETERequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential + $Endpoint = "/api/service_desk/tickets/{0}" -f $Id + + If ($PSCmdlet.ShouldProcess($Server, "DELETE $Endpoint")) { + $Result = New-ApiDELETERequest -Endpoint $Endpoint } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/public/service_desk/Set-ServiceDeskTicket.ps1 b/public/service_desk/Set-ServiceDeskTicket.ps1 index a563300..23d929d 100644 --- a/public/service_desk/Set-ServiceDeskTicket.ps1 +++ b/public/service_desk/Set-ServiceDeskTicket.ps1 @@ -1,72 +1,37 @@ Function Set-ServiceDeskTicket { - <# - .DESCRIPTION - Updates a ticket. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER TicketID - The ID of the ticket you want to update - - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - - - Set-SmaServiceDeskTicket -Server https://kace.example.com -Org Default -Credential (Get-Credential) -TicketID 1234 -Body $TicketUpdate - - Updates a ticket with ID 1234 with the information provided by the $body - - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'medium' )] param( - [Parameter(Mandatory = $true,Position=0)] - [string] - $TicketID, - - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, - - [Parameter(Mandatory = $true)] + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('TicketId')] + [int] + $Id, + + [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [hashtable] $Body ) - Begin { - $Endpoint = "/api/service_desk/tickets/$TicketID" - } + Begin { } Process { - If ($PSCmdlet.ShouldProcess($Server,"PUT $Endpoint")) { - New-ApiPUTRequest -Server $Server -Endpoint $Endpoint -Org $Org -Credential $Credential -Body $Body + $Endpoint = "/api/service_desk/tickets/{0}" -f $Id + + If ($PSCmdlet.ShouldProcess($Server, "PUT $Endpoint")) { + $newApiPUTRequestSplat = @{ + Body = $Body + Endpoint = $Endpoint + } + $Result = New-ApiPUTRequest @newApiPUTRequestSplat } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/public/users/Get-CurrentUserAccount.ps1 b/public/users/Get-CurrentUserAccount.ps1 index 0d40517..e1e407a 100644 --- a/public/users/Get-CurrentUserAccount.ps1 +++ b/public/users/Get-CurrentUserAccount.ps1 @@ -1,56 +1,16 @@ Function Get-CurrentUserAccount { - <# - .DESCRIPTION - Returns information about the current SMA user account being used to perform the api query. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaCurrentUserAccount -Server https://kace.example.com -Org Default -Credential (Get-Credential) - - Retrieves information about the current API user performing the query. - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] - param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential - ) - Begin { - $Endpoint = "/api/users/me" - } + param( ) + Begin { } Process { + $Endpoint = "/api/users/me" + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + New-ApiGETRequest -Endpoint $Endpoint } } - End {} + End { } } \ No newline at end of file diff --git a/public/users/Get-UserPermissions.ps1 b/public/users/Get-UserPermissions.ps1 index 192ba74..67150b6 100644 --- a/public/users/Get-UserPermissions.ps1 +++ b/public/users/Get-UserPermissions.ps1 @@ -1,56 +1,18 @@ Function Get-UserPermissions { - <# - .DESCRIPTION - Returns information about an SMA user permissions. - - .PARAMETER Server - The fully qualified name (FQDN) of the SMA Appliance. - Example: https://kace.example.com - - .PARAMETER Org - The SMA Organization you want to retrieve information from. If not provided, 'Default' is used. - - .PARAMETER Credential - A credential for the kace appliance that has permissions to interact with the API. - To run interactively, use -Credential (Get-Credential) - - .PARAMETER UserID - (Optional) Use if you want to return a specific user's permissions from the SMA. - ID can be found in SMA Admin > Settings > Users, then looking at the ID= in the url. - - .INPUTS - - .OUTPUTS - PSCustomObject - - .EXAMPLE - Get-SmaUserPermissions -Server https://kace.example.com -Org Default -Credential (Get-Credential) -UserID 1234 - - Retrieves information about the permissions for a user with ID 1234 - - .NOTES - - #> [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( - [Parameter(Mandatory = $true)] - [string] - $Server, - - [Parameter()] - [string] - $Org = 'Default', - - [Parameter(Mandatory = $true)] - [string] - $UserID, - - [Parameter(Mandatory = $true)] - [PSCredential] - $Credential, + [Parameter( + Mandatory, + Position = 0, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('AssetId')] + [int] + $Id, [Parameter()] [ValidatePattern("^\?")] @@ -59,12 +21,20 @@ Function Get-UserPermissions { ) Begin { - $Endpoint = "/api/users/$UserID/permissions" + } Process { + $Endpoint = "/api/users/{0}/permissions" -f $Id + If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { - New-ApiGETRequest -Server $Server -Endpoint $Endpoint -Org $Org -QueryParameters $QueryParameters -Credential $Credential + $newApiGETRequestSplat = @{ + QueryParameters = $QueryParameters + Endpoint = $Endpoint + } + $Result = New-ApiGETRequest @newApiGETRequestSplat } } - End {} + End { + $Result + } } \ No newline at end of file diff --git a/tests/functions.Tests.ps1 b/tests/functions.Tests.ps1 index 4784d9b..61b6d05 100644 --- a/tests/functions.Tests.ps1 +++ b/tests/functions.Tests.ps1 @@ -46,17 +46,7 @@ Describe "General Function Tests" { It "PUBLIC function $function.ps1 should exist" { "$root\public\*\$function.ps1" | Should -Exist } - It "PUBLIC function $function.ps1 HELP block should exist" { - "$root\public\*\$function.ps1" | Should -FileContentMatch '<#' - "$root\public\*\$function.ps1" | Should -FileContentMatch '#>' - - } - It "PUBLIC function $function.ps1 should have Example" { - "$root\public\*\$function.ps1" | Should -FileContentMatch '.EXAMPLE' - } - It "PUBLIC function $function.ps1 should have Description" { - "$root\public\*\$function.ps1" | Should -FileContentMatch '.DESCRIPTION' - } + It "$function.ps1 is valid Powershell code" { $psFile = Get-Content -Path "$root\public\*\$function.ps1" -ErrorAction Stop $errors = $null diff --git a/tests/unit/Get-SmaAgentlessInventory.tests.ps1 b/tests/unit/Get-SmaAgentlessInventory.tests.ps1 index 5a2452e..c62fb2c 100644 --- a/tests/unit/Get-SmaAgentlessInventory.tests.ps1 +++ b/tests/unit/Get-SmaAgentlessInventory.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaAgentlessInventory Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -10,68 +5,30 @@ Describe 'Get-SmaAgentlessInventory Unit Tests' -Tags 'Unit' { Mock New-ApiPostRequest {} -ModuleName KaceSMA Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA + + It 'should call only New-ApiGETRequest' { + Get-SmaAgentlessInventory -Id 1234 -QueryParameters "?paging=50" - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - $NodesIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - NodesID = '1234' - QueryParameters = "?paging=50" - } - - Get-SmaAgentlessInventory @NodesIDParams - - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call generic endpoint if NodesID parameter is not specified" { - $Generic = $(Get-SmaAgentlessInventory @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/inventory/nodes" on target "https://foo".' - } - - It "should call NodesID endpoint if NodesID parameter is specified" { - $WithNodesID = $(Get-SmaAgentlessInventory @NodesIDParams -Verbose) 4>&1 - $WithNodesID | Should -Be 'Performing the operation "GET /api/inventory/nodes/1234" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'Machines'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } + It "Should take parameter from pipeline" { + {1234 | Get-SmaAgentlessInventory} | Should -Not -Throw - It 'should produce [PSCustomObject] output' { + } - $output = Get-SmaAgentlessInventory @GenericParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; Machines=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaAgentlessInventory -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaArchiveAsset.tests.ps1 b/tests/unit/Get-SmaArchiveAsset.tests.ps1 deleted file mode 100644 index a832f83..0000000 --- a/tests/unit/Get-SmaArchiveAsset.tests.ps1 +++ /dev/null @@ -1,74 +0,0 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - -Describe 'Get-SmaArchiveAsset Unit Tests' -Tags 'Unit' { - InModuleScope KaceSMA { - Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - $AssetIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - AssetID = '1234' - QueryParameters = "?paging=50" - } - - Get-SmaArchiveAsset @AssetIDParams - - It 'should call New-ApiGETRequest' { - Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') - Foreach ($Method in $Methods) { - Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 - } - } - - It "should call AssetID endpoint only" { - $WithAssetID = $(Get-SmaArchiveAsset @AssetIDParams -Verbose) 4>&1 - $WithAssetID | Should -Be 'Performing the operation "GET /api/asset/archived_devices/1234" on target "https://foo".' - } - } - - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'Machines'=@{}} - return $MockResponse - } -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - It 'should produce [PSCustomObject] output' { - - $output = Get-SmaArchiveAsset @GenericParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; Machines=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject - } - } - } -} - diff --git a/tests/unit/Get-SmaAsset.tests.ps1 b/tests/unit/Get-SmaAsset.tests.ps1 index 231a744..6b6efe4 100644 --- a/tests/unit/Get-SmaAsset.tests.ps1 +++ b/tests/unit/Get-SmaAsset.tests.ps1 @@ -1,91 +1,34 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaAsset Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - $AssetIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - AssetID = '1234' - QueryParameters = "?paging=50" - } - - $AsBarcodesParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - AssetID = '1234' - AsBarcodes = $True - QueryParameters = "?paging=50" - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA - Get-SmaAsset @AssetIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaAsset -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call generic endpoint if AssetID parameter is NOT specified" { - $Generic = $(Get-SmaAsset @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/asset/assets" on target "https://foo".' - } - - It "should call AssetID endpoint if AssetID parameter is specified" { - $WithAssetID = $(Get-SmaAsset @AssetIDParams -Verbose) 4>&1 - $WithAssetID | Should -Be 'Performing the operation "GET /api/asset/assets/1234" on target "https://foo".' - } - - It "should call AsBarcodes endpoint if AsBarcodes parameter is specified" { - $AsBarcodes = $(Get-SmaAsset @AsBarcodesParams -Verbose) 4>&1 - $AsBarcodes | Should -Be 'Performing the operation "GET /api/asset/assets/1234/barcodes" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'Assets'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } + It "Should take parameter from pipeline" { + {1234 | Get-SmaAsset} | Should -Not -Throw - It 'should produce [PSCustomObject] output' { + } - $output = Get-SmaAsset @GenericParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; Assets=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaAsset -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaAssetType.tests.ps1 b/tests/unit/Get-SmaAssetType.tests.ps1 index 057f0ad..1e9c718 100644 --- a/tests/unit/Get-SmaAssetType.tests.ps1 +++ b/tests/unit/Get-SmaAssetType.tests.ps1 @@ -1,66 +1,22 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaAssetType Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - Get-SmaAssetType @GenericParams - - It 'should call New-ApiGETRequest' { + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA + + It 'should call only New-ApiGETRequest' { + Get-SmaAssetType -QueryParameters "?paging=50" + Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - - It "should call generic endpoint" { - $Generic = $(Get-SmaAssetType @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/asset/assets/types" on target "https://foo".' - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } } - - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'AssetTypes'=@{}} - return $MockResponse - } -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - It 'should produce [PSCustomObject] output' { - - $output = Get-SmaAssetType @GenericParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; AssetTypes=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject - } - } } } diff --git a/tests/unit/Get-SmaBarcodeAsset.tests.ps1 b/tests/unit/Get-SmaBarcodeAsset.tests.ps1 index bd10c4c..35c98ba 100644 --- a/tests/unit/Get-SmaBarcodeAsset.tests.ps1 +++ b/tests/unit/Get-SmaBarcodeAsset.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaBarcodeAsset Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,67 +6,31 @@ Describe 'Get-SmaBarcodeAsset Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - $BarcodeIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - BarcodeID = 1234 - QueryParameters = "?paging=50" - } + Get-SmaBarcodeAsset -QueryParameters "?paging=50" - Get-SmaBarcodeAsset @GenericParams + It 'should call only New-ApiGETRequest' { + Get-SmaAsset -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - - It "should call generic endpoint" { - $Generic = $(Get-SmaBarcodeAsset @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/asset/barcodes" on target "https://foo".' - } - It "should call BarcodeID endpoint if BarcodeID parameter is specified" { - $WithBarcodeID = $(Get-SmaBarcodeAsset @BarcodeIDParams -Verbose) 4>&1 - $WithBarcodeID | Should -Be 'Performing the operation "GET /api/asset/barcodes/1234" on target "https://foo".' - } - - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'Barcodes'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + # Mock a return object from the SMA with a single property, Id + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" + It "Should take parameter from pipeline" { + {1234 | Get-SmaBarcodeAsset} | Should -Not -Throw } - It 'should produce [PSCustomObject] output' { - - $output = Get-SmaBarcodeAsset @GenericParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; Barcodes=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaBarcodeAsset -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaCurrentUserAccount.tests.ps1 b/tests/unit/Get-SmaCurrentUserAccount.tests.ps1 index 307756b..154b771 100644 --- a/tests/unit/Get-SmaCurrentUserAccount.tests.ps1 +++ b/tests/unit/Get-SmaCurrentUserAccount.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaCurrentUserAccount Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,98 +6,19 @@ Describe 'Get-SmaCurrentUserAccount Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - } + Get-SmaCurrentUserAccount - Get-SmaCurrentUserAccount @GenericParams + It 'should call only New-ApiGETRequest' { + Get-SmaAsset -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call generic endpoint" { - $Generic = $(Get-SmaCurrentUserAccount @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/users/me" on target "https://foo".' - } - } - - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{ - userId = '' - permissions = @{} - canAddTickets = 'True' - canAddTicketsUserPortal = 'True' - licensedFeatures = @{} - supportAvailable = 1 - deviceScope = @{} - loggedin = '' - loggedinId = 1 - loggedinEmail = '' - loggedinFullName = '' - orgs = @{} - currentOrgId = @{} - serialNumber = '' - localTimezone = '' - RESTAPIVersion = 1 - defaultQueueID = 0 - apiEnabled = 1 - } - return $MockResponse - } -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - } - - It 'should produce [PSCustomObject] output' { - - $output = Get-SmaCurrentUserAccount @GenericParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject - } - - It 'should have valid NoteProperty values' { - $NoteProperties = @( - 'apiEnabled' - 'canAddTickets' - 'canAddTicketsUserPortal' - 'currentOrgId' - 'defaultQueueID' - 'deviceScope' - 'licensedFeatures' - 'localTimezone' - 'loggedin' - 'loggedinEmail' - 'loggedinFullName' - 'loggedinID' - 'orgs' - 'permissions' - 'RESTAPIVersion' - 'serialNumber' - 'supportAvailable' - 'userID' - ) - $output = Get-SmaCurrentUserAccount @GenericParams - ($output | Get-Member -Type NoteProperty).Name | Should -Be $NoteProperties - ($output | Get-Member -Type NoteProperty).Count | Should -Be 18 - - } } } } diff --git a/tests/unit/Get-SmaMachineInventory.Tests.ps1 b/tests/unit/Get-SmaMachineInventory.Tests.ps1 index a1dd1c8..8b2164c 100644 --- a/tests/unit/Get-SmaMachineInventory.Tests.ps1 +++ b/tests/unit/Get-SmaMachineInventory.Tests.ps1 @@ -1,77 +1,34 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaMachineInventory Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - $MachineIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - MachineID = '1234' - QueryParameters = "?paging=50" - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA - Get-SmaMachineInventory @MachineIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaMachineInventory -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call generic endpoint if MachineID parameter is not specified" { - $Generic = $(Get-SmaMachineInventory @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/inventory/machines" on target "https://foo".' - } - - It "should call MachineID endpoint if MachineID parameter is specified" { - $WithMachineID = $(Get-SmaMachineInventory @MachineIDParams -Verbose) 4>&1 - $WithMachineID | Should -Be 'Performing the operation "GET /api/inventory/machines/1234" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'Machines'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } + It "Should take parameter from pipeline" { + { 1234 | Get-SmaMachineInventory } | Should -Not -Throw - It 'should produce [PSCustomObject] output' { + } - $output = Get-SmaMachineInventory @GenericParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; Machines=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + { Get-SmaMachineInventory -Id 1234 } | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaMachineProcess.tests.ps1 b/tests/unit/Get-SmaMachineProcess.tests.ps1 index f23a8e4..b2a637c 100644 --- a/tests/unit/Get-SmaMachineProcess.tests.ps1 +++ b/tests/unit/Get-SmaMachineProcess.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaMachineProcess Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,67 +6,29 @@ Describe 'Get-SmaMachineProcess Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - $ProcessIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ProcessID = '1234' - QueryParameters = "?paging=50" - } - - Get-SmaMachineProcess @ProcessIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaMachineProcess -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call generic endpoint if ProcessID parameter is not specified" { - $Generic = $(Get-SmaMachineProcess @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/inventory/processes" on target "https://foo".' - } - - It "should call ProcessID endpoint if ProcessID parameter is specified" { - $WithProcessID = $(Get-SmaMachineProcess @ProcessIDParams -Verbose) 4>&1 - $WithProcessID | Should -Be 'Performing the operation "GET /api/inventory/processes/1234" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'Processes'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } + It "Should take parameter from pipeline" { + {1234 | Get-SmaMachineProcess} | Should -Not -Throw - It 'should produce [PSCustomObject] output' { + } - $output = Get-SmaMachineProcess @GenericParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; Processes=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaMachineProcess -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaMachineService.tests.ps1 b/tests/unit/Get-SmaMachineService.tests.ps1 index 860eda8..2674491 100644 --- a/tests/unit/Get-SmaMachineService.tests.ps1 +++ b/tests/unit/Get-SmaMachineService.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaMachineService Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,67 +6,29 @@ Describe 'Get-SmaMachineService Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - $ServiceIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ServiceID = '1234' - QueryParameters = "?paging=50" - } - - Get-SmaMachineService @ServiceIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaMachineService -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call generic endpoint if ServiceID parameter is not specified" { - $Generic = $(Get-SmaMachineService @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/inventory/services" on target "https://foo".' - } - - It "should call ServiceID endpoint if ServiceID parameter is specified" { - $WithServiceID = $(Get-SmaMachineService @ServiceIDParams -Verbose) 4>&1 - $WithServiceID | Should -Be 'Performing the operation "GET /api/inventory/services/1234" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'Services'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } + It "Should take parameter from pipeline" { + {1234 | Get-SmaMachineService} | Should -Not -Throw - It 'should produce [PSCustomObject] output' { + } - $output = Get-SmaMachineService @GenericParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; Services=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaMachineService -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaManagedInstall.tests.ps1 b/tests/unit/Get-SmaManagedInstall.tests.ps1 index 5c890bf..b31bef1 100644 --- a/tests/unit/Get-SmaManagedInstall.tests.ps1 +++ b/tests/unit/Get-SmaManagedInstall.tests.ps1 @@ -1,82 +1,34 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaManagedInstall Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - $ManagedInstallIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ManagedInstallID = '1234' - QueryParameters = "?paging=50" - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA - Get-SmaManagedInstall @ManagedInstallIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaManagedInstall -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call generic endpoint if ManagedInstallID parameter is not specified" { - $Generic = $(Get-SmaManagedInstall @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/managed_install/managed_installs" on target "https://foo".' - } - - It "should call ManagedInstallID endpoint if ManagedInstallID parameter is specified" { - $WithManagedInstallID = $(Get-SmaManagedInstall @ManagedInstallIDParams -Verbose) 4>&1 - $WithManagedInstallID | Should -Be 'Performing the operation "GET /api/managed_install/managed_installs/1234" on target "https://foo".' - } - - It "should call ListCompatibleMachines endpoint if ListCompatibleMachines parameter is specified" { - $WithManagedInstallID = $(Get-SmaManagedInstall @ManagedInstallIDParams -Verbose) 4>&1 - $WithManagedInstallID | Should -Be 'Performing the operation "GET /api/managed_install/managed_installs/1234" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'MIs'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } + It "Should take parameter from pipeline" { + { 1234 | Get-SmaManagedInstall } | Should -Not -Throw - It 'should produce [PSCustomObject] output' { + } - $output = Get-SmaManagedInstall @GenericParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; MIs=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + { Get-SmaManagedInstall -Id 1234 } | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaManagedInstallMachineCompatibility.tests.ps1 b/tests/unit/Get-SmaManagedInstallMachineCompatibility.tests.ps1 index 0694f2e..0de204e 100644 --- a/tests/unit/Get-SmaManagedInstallMachineCompatibility.tests.ps1 +++ b/tests/unit/Get-SmaManagedInstallMachineCompatibility.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaManagedInstallMachineCompatibility Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,57 +6,30 @@ Describe 'Get-SmaManagedInstallMachineCompatibility Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $MachineIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - MachineID = '1234' - QueryParameters = "?paging=50" - } - - Get-SmaManagedInstallMachineCompatibility @MachineIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaManagedInstallMachineCompatibility -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - It "should call MachineID endpoint if MachineID parameter is specified" { - $WithMachineID = $(Get-SmaManagedInstallMachineCompatibility @MachineIDParams -Verbose) 4>&1 - $WithMachineID | Should -Be 'Performing the operation "GET /api/managed_install/machines/1234" on target "https://foo".' - } - } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'Machines'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $MachineIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - MachineID = '1234' - QueryParameters = "?paging=50" - } + It "Should take parameter from pipeline" { + {1234 | Get-SmaManagedInstallMachineCompatibility} | Should -Not -Throw - It 'should produce [PSCustomObject] output' { + } - $output = Get-SmaManagedInstallMachineCompatibility @MachineIDParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; Machines=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaManagedInstallMachineCompatibility -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaOperatingSystemInventory.tests.ps1 b/tests/unit/Get-SmaOperatingSystemInventory.tests.ps1 index c6d8474..11ced12 100644 --- a/tests/unit/Get-SmaOperatingSystemInventory.tests.ps1 +++ b/tests/unit/Get-SmaOperatingSystemInventory.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaOperatingSystemInventory Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,67 +6,29 @@ Describe 'Get-SmaOperatingSystemInventory Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - $MachineIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - MachineID = '1234' - QueryParameters = "?paging=50" - } - - Get-SmaOperatingSystemInventory @MachineIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaOperatingSystemInventory -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call generic endpoint if MachineID parameter is not specified" { - $Generic = $(Get-SmaOperatingSystemInventory @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/inventory/operating_systems" on target "https://foo".' - } - - It "should call MachineID endpoint if MachineID parameter is specified" { - $WithMachineID = $(Get-SmaOperatingSystemInventory @MachineIDParams -Verbose) 4>&1 - $WithMachineID | Should -Be 'Performing the operation "GET /api/inventory/operating_systems/1234" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'OperatingSystems'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } + It "Should take parameter from pipeline" { + {1234 | Get-SmaOperatingSystemInventory} | Should -Not -Throw - It 'should produce [PSCustomObject] output' { + } - $output = Get-SmaOperatingSystemInventory @GenericParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; OperatingSystems=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaOperatingSystemInventory -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaReportingDefinition.tests.ps1 b/tests/unit/Get-SmaReportingDefinition.tests.ps1 index 0d2acbb..a0d1886 100644 --- a/tests/unit/Get-SmaReportingDefinition.tests.ps1 +++ b/tests/unit/Get-SmaReportingDefinition.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaReportingDefinition Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,93 +6,29 @@ Describe 'Get-SmaReportingDefinition Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?orgID=1" - } - - $DefinitionIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - DefinitionID = '1234' - QueryParameters = "?orgID=1" - } - - $DefinitionNameParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - DefinitionName = 'fooname' - QueryParameters = "?orgID=1" - } - - $DistinctFieldParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - DistinctField = 'foofield' - QueryParameters = "?orgID=1" - } - - Get-SmaReportingDefinition @DefinitionIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaReportingDefinition -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call generic endpoint if no additional parameters are specified" { - $Generic = $(Get-SmaReportingDefinition @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/reporting/definitions" on target "https://foo".' - } - - It "should call DefinitionID endpoint if DefinitionID parameter is specified" { - $WithDefinitionID = $(Get-SmaReportingDefinition @DefinitionIDParams -Verbose) 4>&1 - $WithDefinitionID | Should -Be 'Performing the operation "GET /api/reporting/definitions/1234" on target "https://foo".' - } - - It "should call DefinitionName endpoint if DefinitionName parameter is specified" { - $WithDefinitionName = $(Get-SmaReportingDefinition @DefinitionNameParams -Verbose) 4>&1 - $WithDefinitionName | Should -Be 'Performing the operation "GET /api/reporting/definitions/fooname" on target "https://foo".' - } - - It "should call DistinctField endpoint if DistinctField parameter is specified" { - $WithDistinctField = $(Get-SmaReportingDefinition @DistinctFieldParams -Verbose) 4>&1 - $WithDistinctField | Should -Be 'Performing the operation "GET /api/reporting/definitions/foofield" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count'=1;'Warnings'=@{};'Definitions'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } + It "Should take parameter from pipeline" { + {1234 | Get-SmaReportingDefinition} | Should -Not -Throw - It 'should produce [PSCustomObject] output' { + } - $output = Get-SmaReportingDefinition @GenericParams - $output | Should -Be "@{Count=1; Warnings=System.Collections.Hashtable; Definitions=System.Collections.Hashtable}" - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaReportingDefinition -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaScript.tests.ps1 b/tests/unit/Get-SmaScript.tests.ps1 index 574babe..ba19ed9 100644 --- a/tests/unit/Get-SmaScript.tests.ps1 +++ b/tests/unit/Get-SmaScript.tests.ps1 @@ -1,97 +1,34 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaScript Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + It 'should call only New-ApiGETRequest' { + Get-SmaScript -Id 1234 -QueryParameters "?paging=50" - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } - - $ScriptIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ScriptID = '1234' - QueryParameters = "?paging=50" - } - - Get-SmaScript @ScriptIDParams - - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call generic endpoint if no additional parameters are specified" { - $Generic = $(Get-SmaScript @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/scripts" on target "https://foo".' - } - - It "should call ScriptID endpoint if ScriptID parameter is specified" { - $WithScriptID = $(Get-SmaScript @ScriptIDParams -Verbose) 4>&1 - $WithScriptID | Should -Be 'Performing the operation "GET /api/script/1234" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{ - id = 1234 - name = 'fooname' - type = 'policy' - scheduletype = 'online-shell' - status = 'Draft' - enabled = 'False' - } - return $MockResponse - } -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueryParameters = "?paging=50" - } + Context 'Parameter input' { - $ScriptIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ScriptID = '1234' - QueryParameters = "?paging=50" - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA - It 'should produce [PSCustomObject] output' { + It "Should take parameter from pipeline" { + { 1234 | Get-SmaScript } | Should -Not -Throw - $output = Get-SmaScript @GenericParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject } - It 'should have valid NoteProperty values' { - $NoteProperties = @('id','name','type','scheduletype','status','enabled') # not an exhaustive list, but should give a good representation of a correct object type - $output = Get-SmaScript @ScriptIDParams - ($output | Get-Member -Type NoteProperty).Name | Should -BeIn $NoteProperties + It "Should take parameter from position" { + { Get-SmaScript -Id 1234 } | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaScriptDependency.tests.ps1 b/tests/unit/Get-SmaScriptDependency.tests.ps1 index 46dd500..205cabe 100644 --- a/tests/unit/Get-SmaScriptDependency.tests.ps1 +++ b/tests/unit/Get-SmaScriptDependency.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaScriptDependency Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,86 +6,28 @@ Describe 'Get-SmaScriptDependency Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $ScriptIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ScriptID = '1234' - } - - $ScriptIDDependencyParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ScriptID = '1234' - DependencyName = 'foodependency' - } - - Get-SmaScriptDependency @ScriptIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaScriptDependency -Id 1234 - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call ScriptID dependencies endpoint if no additional parameters are specified" { - $Generic = $(Get-SmaScriptDependency @ScriptIDParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/script/1234/dependencies" on target "https://foo".' - } - - It "should call script DependencyName endpoint if DependencyName parameter is specified" { - $WithScriptID = $(Get-SmaScriptDependency @ScriptIDDependencyParams -Verbose) 4>&1 - $WithScriptID | Should -Be 'Performing the operation "GET /api/script/1234/dependency/foodependency" on target "https://foo".' - } - - It 'should return empty if there are no dependencies' { - Get-SmaScriptDependency @ScriptIDParams | Should -BeNullOrEmpty - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{ - name = 'foo.bat' - checksum = 'abc123' - } - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $ScriptIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ScriptID = '1234' - } - - $ScriptIDDependencyParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ScriptID = '1234' - DependencyName = 'foodependency' - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA - It 'should produce [PSCustomObject] output' { - $output = Get-SmaScriptDependency @ScriptIDParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from pipeline" { + {1234 | Get-SmaScriptDependency} | Should -Not -Throw } - It 'should have valid NoteProperty values' { - $NoteProperties = @('checksum','name') - $output = Get-SmaScriptDependency @ScriptIDDependencyParams - ($output | Get-Member -Type NoteProperty).Name | Should -Be $NoteProperties + It "Should take parameter from position" { + {Get-SmaScriptDependency -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaScriptRunStatus.tests.ps1 b/tests/unit/Get-SmaScriptRunStatus.tests.ps1 index 5c91068..236fb0b 100644 --- a/tests/unit/Get-SmaScriptRunStatus.tests.ps1 +++ b/tests/unit/Get-SmaScriptRunStatus.tests.ps1 @@ -1,71 +1,34 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaScriptRunStatus Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $RunIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - RunID = 1234 - - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA - Get-SmaScriptRunStatus @RunIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaScriptRunStatus -Id 1234 - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call RunID endpoint if MachineID parameter is not specified" { - $RunID = $(Get-SmaScriptRunStatus @RunIDParams -Verbose) 4>&1 - $RunID | Should -Be 'Performing the operation "GET /api/script/runstatus/1234" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'scriptId'=1234;'Targeted'=@{};'Pending'=@{};'Success'=@{};'pushFailed'=@{};'failed'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $RunIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - RunID = 1234 + It "Should take parameter from pipeline" { + { 1234 | Get-SmaScriptRunStatus } | Should -Not -Throw } - It 'should produce [PSCustomObject] output' { - $output = Get-SmaScriptRunStatus @RunIDParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + { Get-SmaScriptRunStatus -Id 1234 } | Should -Not -Throw } - - It 'should have valid NoteProperty values' { - $NoteProperties = @('failed','pending','pushFailed','scriptId','success','targeted') - $output = Get-SmaScriptRunStatus @RunIDParams - ($output | Get-Member -Type NoteProperty).Name | Should -BeIn $NoteProperties - } - } } } diff --git a/tests/unit/Get-SmaScriptTask.tests.ps1 b/tests/unit/Get-SmaScriptTask.tests.ps1 index 2e647af..b10d4e2 100644 --- a/tests/unit/Get-SmaScriptTask.tests.ps1 +++ b/tests/unit/Get-SmaScriptTask.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaScriptTask Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,45 +6,16 @@ Describe 'Get-SmaScriptTask Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $ScriptIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ScriptID = 1234 - } - - $OrderIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ScriptID = 1234 - OrderID = 1 - } - - Get-SmaScriptTask @ScriptIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaScriptTask -Id 1234 - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call ScriptId endpoint if OrderID is not specified" { - $WithScriptId = $(Get-SmaScriptTask @ScriptIDParams -Verbose) 4>&1 - $WithScriptId | Should -Be 'Performing the operation "GET /api/script/1234/tasks" on target "https://foo".' - } - - It "should call OrderId endpoint if OrderId is specified" { - $WithOrderID = $(Get-SmaScriptTask @OrderIDParams -Verbose) 4>&1 - $WithOrderID | Should -Be 'Performing the operation "GET /api/script/1234/task/1" on target "https://foo".' - } } Context 'Function Output' { @@ -58,12 +24,7 @@ Describe 'Get-SmaScriptTask Unit Tests' -Tags 'Unit' { return $MockResponse } -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - $ScriptIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' ScriptID = 1234 } diff --git a/tests/unit/Get-SmaServiceDeskQueue.tests.ps1 b/tests/unit/Get-SmaServiceDeskQueue.tests.ps1 index f3fc4fa..0229f26 100644 --- a/tests/unit/Get-SmaServiceDeskQueue.tests.ps1 +++ b/tests/unit/Get-SmaServiceDeskQueue.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaServiceDeskQueue Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,73 +6,28 @@ Describe 'Get-SmaServiceDeskQueue Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - } - - $QueueIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueueID = 1 - } - - - Get-SmaServiceDeskQueue @GenericParams + It 'should call only New-ApiGETRequest' { + Get-SmaServiceDeskQueue -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call generic endpoint if -QueueID is not specified" { - $WithQueueID = $(Get-SmaServiceDeskQueue @GenericParams -Verbose) 4>&1 - $WithQueueID | Should -Be 'Performing the operation "GET /api/service_desk/queues" on target "https://foo".' - } - - It "should call QueueID endpoint if -QueueID is specified" { - $WithQueueID = $(Get-SmaServiceDeskQueue @QueueIDParams -Verbose) 4>&1 - $WithQueueID | Should -Be 'Performing the operation "GET /api/service_desk/queues/1" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'count'=1;'Warnings'=@{};'Queues'=@{}} - return $MockResponse - } -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Context 'Parameter input' { - $QueueIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueueID = 1 - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA - It 'should produce [PSCustomObject] output' { - $output = Get-SmaServiceDeskQueue @QueueIDParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from pipeline" { + {1234 | Get-SmaServiceDeskQueue} | Should -Not -Throw } - If ($QueueIdParams.QueueId) { - It 'Specifying -QueueID should only return count of 1' { - # this will always return true due to the mock response being hard coded to 1. - # It is provided as a basis for integration tests if desired. - $output = Get-SmaServiceDeskQueue @QueueIDParams - $output.Count | Should -Be 1 - } + It "Should take parameter from position" { + {Get-SmaServiceDeskQueue -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaServiceDeskQueueField.tests.ps1 b/tests/unit/Get-SmaServiceDeskQueueField.tests.ps1 index e573490..a75fdd7 100644 --- a/tests/unit/Get-SmaServiceDeskQueueField.tests.ps1 +++ b/tests/unit/Get-SmaServiceDeskQueueField.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaServiceDeskQueueField Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,54 +6,29 @@ Describe 'Get-SmaServiceDeskQueueField Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $QueueIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueueID = 1234 - } - + It 'should call only New-ApiGETRequest' { + Get-SmaServiceDeskQueueField -Id 1234 -QueryParameters "?paging=50" - Get-SmaServiceDeskQueueField @QueueIDParams - - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - It "should call QueueID $($QueueIDParams.QueueID)/fields endpoint" { - $WithQueueID = $(Get-SmaServiceDeskQueueField @QueueIDParams -Verbose) 4>&1 - $WithQueueID | Should -Be 'Performing the operation "GET /api/service_desk/queues/1234/fields" on target "https://foo".' - } - } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Fields'=@{'jsonKey'='title';'label'='Title';'column'='TITLE';'type'='text';'visible'='usercreate';'required'='all'}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $QueueIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueueID = 1 + It "Should take parameter from pipeline" { + {1234 | Get-SmaServiceDeskQueueField} | Should -Not -Throw } - It 'should produce [PSCustomObject] output' { - $output = Get-SmaServiceDeskQueueField @QueueIDParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaServiceDeskQueueField -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaServiceDeskTicket.tests.ps1 b/tests/unit/Get-SmaServiceDeskTicket.tests.ps1 index e1abde7..85d6c18 100644 --- a/tests/unit/Get-SmaServiceDeskTicket.tests.ps1 +++ b/tests/unit/Get-SmaServiceDeskTicket.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaServiceDeskTicket Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,64 +6,29 @@ Describe 'Get-SmaServiceDeskTicket Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - } - - $TicketIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - TicketID = 1234 - } - - - Get-SmaServiceDeskTicket @GenericParams + It 'should call only New-ApiGETRequest' { + Get-SmaServiceDeskTicket -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - It "should call generic endpoint if -TicketID is not specified" { - $WithoutTicketID = $(Get-SmaServiceDeskTicket @GenericParams -Verbose) 4>&1 - $WithoutTicketID | Should -Be 'Performing the operation "GET /api/service_desk/tickets" on target "https://foo".' - } - - It "should call TicketID $($TicketIDParams.TicketID)/fields endpoint if specified" { - $WithTicketID = $(Get-SmaServiceDeskTicket @TicketIDParams -Verbose) 4>&1 - $WithTicketID | Should -Be 'Performing the operation "GET /api/service_desk/tickets/1234" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'count'=1;'warnings'=@{};'Tickets'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $TicketIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - TicketID = 1 + It "Should take parameter from pipeline" { + {1234 | Get-SmaServiceDeskTicket} | Should -Not -Throw } - It 'should produce [PSCustomObject] output' { - $output = Get-SmaServiceDeskTicket @TicketIDParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaServiceDeskTicket -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaServiceDeskTicketChanges.tests.ps1 b/tests/unit/Get-SmaServiceDeskTicketChanges.tests.ps1 index 5648eeb..c605ed0 100644 --- a/tests/unit/Get-SmaServiceDeskTicketChanges.tests.ps1 +++ b/tests/unit/Get-SmaServiceDeskTicketChanges.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaServiceDeskTicketChanges Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,54 +6,29 @@ Describe 'Get-SmaServiceDeskTicketChanges Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $TicketIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - TicketID = 1234 - } - + It 'should call only New-ApiGETRequest' { + Get-SmaServiceDeskTicketChanges -Id 1234 -QueryParameters "?paging=50" - Get-SmaServiceDeskTicketChanges @TicketIDParams - - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - It "should call TicketID $($TicketIDParams.TicketID)/changes endpoint" { - $WithTicketID = $(Get-SmaServiceDeskTicketChanges @TicketIDParams -Verbose) 4>&1 - $WithTicketID | Should -Be 'Performing the operation "GET /api/service_desk/tickets/1234/changes" on target "https://foo".' - } - } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'count'=1;'warnings'=@{};'Changes'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $TicketIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - TicketID = 1234 + It "Should take parameter from pipeline" { + {1234 | Get-SmaServiceDeskTicketChanges} | Should -Not -Throw } - It 'should produce [PSCustomObject] output' { - $output = Get-SmaServiceDeskTicketChanges @TicketIDParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaServiceDeskTicketChanges -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaServiceDeskTicketTemplate.tests.ps1 b/tests/unit/Get-SmaServiceDeskTicketTemplate.tests.ps1 index 525a558..3f721de 100644 --- a/tests/unit/Get-SmaServiceDeskTicketTemplate.tests.ps1 +++ b/tests/unit/Get-SmaServiceDeskTicketTemplate.tests.ps1 @@ -1,64 +1,34 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaServiceDeskTicketTemplate Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $QueueIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueueID = 1234 - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA + It 'should call only New-ApiGETRequest' { + Get-SmaServiceDeskTicketTemplate -Id 1234 -QueryParameters "?paging=50" - Get-SmaServiceDeskTicketTemplate @QueueIDParams - - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - It "should call QueueID $($QueueIDParams.QueueID)/ticket_template endpoint" { - $WithQueueID = $(Get-SmaServiceDeskTicketTemplate @QueueIDParams -Verbose) 4>&1 - $WithQueueID | Should -Be 'Performing the operation "GET /api/service_desk/queues/1234/ticket_template" on target "https://foo".' - } - } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Tickets'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $QueueIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - QueueID = 1234 + It "Should take parameter from pipeline" { + { 1234 | Get-SmaServiceDeskTicketTemplate } | Should -Not -Throw } - It 'should produce [PSCustomObject] output' { - $output = Get-SmaServiceDeskTicketTemplate @QueueIDParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + { Get-SmaServiceDeskTicketTemplate -Id 1234 } | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaSoftwareInventory.tests.ps1 b/tests/unit/Get-SmaSoftwareInventory.tests.ps1 index 58d1168..277c176 100644 --- a/tests/unit/Get-SmaSoftwareInventory.tests.ps1 +++ b/tests/unit/Get-SmaSoftwareInventory.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaSoftwareInventory Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,64 +6,29 @@ Describe 'Get-SmaSoftwareInventory Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - } - - $SoftwareIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - SoftwareID = 1234 - } - - - Get-SmaSoftwareInventory @SoftwareIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaSoftwareInventory -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - It "should call generic endpoint if SoftwareID is not defined." { - $Generic = $(Get-SmaSoftwareInventory @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/inventory/softwares" on target "https://foo".' - } - It "should call SoftwareID $($SoftwareIDParams.SoftwareID)/changes endpoint" { - $WithSoftwareID = $(Get-SmaSoftwareInventory @SoftwareIDParams -Verbose) 4>&1 - $WithSoftwareID | Should -Be 'Performing the operation "GET /api/inventory/softwares/1234" on target "https://foo".' - } - } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Tickets'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $SoftwareIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - SoftwareID = 1234 + It "Should take parameter from pipeline" { + {1234 | Get-SmaSoftwareInventory} | Should -Not -Throw } - It 'should produce [PSCustomObject] output' { - $output = Get-SmaSoftwareInventory @SoftwareIDParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaSoftwareInventory -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaStartupProgramInventory.tests.ps1 b/tests/unit/Get-SmaStartupProgramInventory.tests.ps1 index 9d707ad..df7baba 100644 --- a/tests/unit/Get-SmaStartupProgramInventory.tests.ps1 +++ b/tests/unit/Get-SmaStartupProgramInventory.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaStartupProgramInventory Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,64 +6,29 @@ Describe 'Get-SmaStartupProgramInventory Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $GenericParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - } - - $ProgramIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ProgramID = 1234 - } - - - Get-SmaStartupProgramInventory @ProgramIDParams + It 'should call only New-ApiGETRequest' { + Get-SmaStartupProgramInventory -Id 1234 -QueryParameters "?paging=50" - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - It "should call generic endpoint if ProgramID is not defined." { - $Generic = $(Get-SmaStartupProgramInventory @GenericParams -Verbose) 4>&1 - $Generic | Should -Be 'Performing the operation "GET /api/inventory/startup_programs" on target "https://foo".' - } - It "should call ProgramID $($ProgramIDParams.ProgramID)/changes endpoint" { - $WithProgramID = $(Get-SmaStartupProgramInventory @ProgramIDParams -Verbose) 4>&1 - $WithProgramID | Should -Be 'Performing the operation "GET /api/inventory/startup_programs/1234" on target "https://foo".' - } - } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{'Count' = 1;'Warnings'=@{};'Tickets'=@{}} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $ProgramIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ProgramID = 1234 + It "Should take parameter from pipeline" { + {1234 | Get-SmaStartupProgramInventory} | Should -Not -Throw } - It 'should produce [PSCustomObject] output' { - $output = Get-SmaStartupProgramInventory @ProgramIDParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaStartupProgramInventory -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Get-SmaUserPermissions.tests.ps1 b/tests/unit/Get-SmaUserPermissions.tests.ps1 index b915f8d..7815a80 100644 --- a/tests/unit/Get-SmaUserPermissions.tests.ps1 +++ b/tests/unit/Get-SmaUserPermissions.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Get-SmaUserPermissions Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,62 +6,29 @@ Describe 'Get-SmaUserPermissions Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $UserIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - UserID = 1234 - } - + It 'should call only New-ApiGETRequest' { + Get-SmaUserPermissions -Id 1234 -QueryParameters "?paging=50" - Get-SmaUserPermissions @UserIDParams - - It 'should call New-ApiGETRequest' { Assert-MockCalled -CommandName New-ApiGETRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','PUT') + $Methods = @('POST', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - It "should call UserID $($UserIDParams.UserID)/permissions endpoint" { - $WithUserID = $(Get-SmaUserPermissions @UserIDParams -Verbose) 4>&1 - $WithUserID | Should -Be 'Performing the operation "GET /api/users/1234/permissions" on target "https://foo".' - } - } - Context 'Function Output' { - Mock New-ApiGetRequest { - $MockResponse = [pscustomobject]@{ - 'userId' = 1 - 'Permissions'=@{} - 'canAddTickets'='True' - 'canAddTicketsUserPortal' = 'True' - 'licensedFeatures' = @{} - 'supportAvailable'=1 - 'deviceScope'=@{} - } - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA - $UserIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - UserID = 1234 + It "Should take parameter from pipeline" { + {1234 | Get-SmaUserPermissions} | Should -Not -Throw } - It 'should produce [PSCustomObject] output' { - $output = Get-SmaUserPermissions @UserIDParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + {Get-SmaUserPermissions -Id 1234} | Should -Not -Throw } } } diff --git a/tests/unit/Invoke-SmaScript.tests.ps1 b/tests/unit/Invoke-SmaScript.tests.ps1 index b40998a..572d017 100644 --- a/tests/unit/Invoke-SmaScript.tests.ps1 +++ b/tests/unit/Invoke-SmaScript.tests.ps1 @@ -1,64 +1,33 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Invoke-SmaScript Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $ScriptIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ScriptID = 1234 - TargetMachineIds=1,2 - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA - Invoke-SmaScript @ScriptIDParams + It 'should call only New-ApiPOSTRequest' { + Invoke-SmaScript -Id 1234 -TargetMachineID 1, 2 - It 'should call New-ApiPOSTRequest' { Assert-MockCalled -CommandName New-ApiPOSTRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('GET','DELETE','PUT') + $Methods = @('GET', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call '/api/script/$($ScriptIDParams.ScriptID)/actions/run' endpoint" { - $WithScriptID = $(Invoke-SmaScript @ScriptIDParams -Verbose) 4>&1 - $WithScriptID | Should -Be 'Performing the operation "POST /api/script/1234/actions/run" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiPostRequest { - $MockResponse = [int32] 5555 - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiPOSTRequest { } -ModuleName KaceSMA - $ScriptIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ScriptID = 1234 - TargetMachineIds=1,2 + It "Should take -ID parameter from pipeline" { + { 1234 | Invoke-SmaScript -TargetMachineID 1, 2 } | Should -Not -Throw } - It 'should produce Int32 output' { - $output = Invoke-SmaScript @ScriptIDParams - $output | Should -BeOfType Int32 + It "Should take -ID parameter from position" { + { Invoke-SmaScript -Id 1234 -TargetMachineID 1, 2 } | Should -Not -Throw } } } diff --git a/tests/unit/New-SmaAsset.tests.ps1 b/tests/unit/New-SmaAsset.tests.ps1 index 3ab75d6..8526e29 100644 --- a/tests/unit/New-SmaAsset.tests.ps1 +++ b/tests/unit/New-SmaAsset.tests.ps1 @@ -1,83 +1,38 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'New-SmaAsset Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA - $NewAgentAsset = @{ - 'Assets' =@( - @{ - 'name'='testAsset' - "asset_type_id" = 5 - 'location_id' = 7080 - 'asset_type_name' = "Computer with Dell Agent" - } - ) - } + - $BodyParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - Body = $NewAgentAsset - } + It 'should call only New-ApiPOSTRequest' { + $NewAgentAsset = @{'foo' = 'foo' } + New-SmaAsset -Body $NewAgentAsset - New-SmaAsset @BodyParams + Assert-MockCalled -CommandName New-ApiPostRequest -ModuleName KaceSMA -Times 1 - It 'should call New-ApiPOSTRequest' { - Assert-MockCalled -CommandName New-ApiPOSTRequest -ModuleName KaceSMA -Times 1 - } - - It 'should not call additional HTTP request methods' { - $Methods = @('GET','DELETE','PUT') + $Methods = @('GET', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call '/api/asset/assets' endpoint" { - $WithBody = $(New-SmaAsset @BodyParams -Verbose) 4>&1 - $WithBody | Should -Be 'Performing the operation "POST /api/asset/assets" on target "https://foo".' - } } - Context 'Function Output' { - Mock New-ApiPostRequest { - $MockResponse = [PSCustomObject]@{'Result'='Success'} - return $MockResponse - } -ModuleName KaceSMA + Context 'Parameter input' { - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Mock New-ApiPOSTRequest { } -ModuleName KaceSMA - $NewAgentAsset = @{ - 'Assets' =@( - @{ - 'name'='testAssetFoo' - "asset_type_id" = 5 - 'location_id' = 7080 - 'asset_type_name' = "Computer with Dell Agent" - } - ) - } - $BodyParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - Body = $NewAgentAsset + $NewAgentAsset = @{'foo' = 'foo' } + + It "Should take parameter from pipeline" { + { $NewAgentAsset | New-SmaAsset } | Should -Not -Throw } - It 'should produce PSCustomObject output' { - $output = New-SmaAsset @BodyParams - $output | Should -BeOfType System.Management.Automation.PSCustomObject + It "Should take parameter from position" { + { New-SmaAsset -Body $NewAgentAsset } | Should -Not -Throw } } } diff --git a/tests/unit/New-SmaScript.tests.ps1 b/tests/unit/New-SmaScript.tests.ps1 deleted file mode 100644 index 5be29c3..0000000 --- a/tests/unit/New-SmaScript.tests.ps1 +++ /dev/null @@ -1,52 +0,0 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - -Describe 'New-SmaScript Unit Tests' -Tags 'Unit' { - InModuleScope KaceSMA { - Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $Body = @{ - 'name' = 'xMy New Script' - 'description' = 'This script is amazing.' - 'enabled' = $False - 'status' = 'Draft' - 'notes'='These are the notes' - 'scheduleType'='online-kscript' - 'alertEnabled' = $False - } - - $NewScriptParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - Body = $Body - } - - New-SmaScript @NewScriptParams - - It 'should call New-ApiPOSTRequest' { - Assert-MockCalled -CommandName New-ApiPOSTRequest -ModuleName KaceSMA -Times 1 - } - - It 'should not call additional HTTP request methods' { - $Methods = @('GET','DELETE','PUT') - Foreach ($Method in $Methods) { - Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 - } - } - - It "should call '/api/script' endpoint" { - $WithBody = $(New-SmaScript @NewScriptParams -Verbose) 4>&1 - $WithBody | Should -Be 'Performing the operation "POST /api/script" on target "https://foo".' - } - } - } -} \ No newline at end of file diff --git a/tests/unit/New-SmaScriptTask.tests.ps1 b/tests/unit/New-SmaScriptTask.tests.ps1 index d1cea71..9d3a3b2 100644 --- a/tests/unit/New-SmaScriptTask.tests.ps1 +++ b/tests/unit/New-SmaScriptTask.tests.ps1 @@ -1,57 +1,54 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'New-SmaScriptTask Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $Body = @{ - 'attempts' = 2 - 'onFailure' = 'break' - 'onRemediationFailure' = @( - @{ - 'id'= 27 - 'params'= [ordered]@{ - 'type'='status' - 'message'='test remediation message2' + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA + + It 'should call only New-ApiPOSTRequest' { + $Body = @{ + 'attempts' = 2 + 'onFailure' = 'break' + 'onRemediationFailure' = @( + @{ + 'id' = 27 + 'params' = [ordered]@{ + 'type' = 'status' + 'message' = 'test remediation message2' + } } - } - ) - } - - $NewScriptTaskParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - ScriptID = 1234 - Body = $Body - } + ) + } - New-SmaScriptTask @NewScriptTaskParams + $NewScriptTaskParams = @{ + ID = 1234 + Body = $Body + } + + New-SmaScriptTask @NewScriptTaskParams - It 'should call New-ApiPOSTRequest' { - Assert-MockCalled -CommandName New-ApiPOSTRequest -ModuleName KaceSMA -Times 1 - } + Assert-MockCalled -CommandName New-ApiPostRequest -ModuleName KaceSMA -Times 1 - It 'should not call additional HTTP request methods' { - $Methods = @('GET','DELETE','PUT') + $Methods = @('GET', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } + } + + Context 'Parameter input' { + + Mock New-ApiPOSTRequest { } -ModuleName KaceSMA - It "should call '/api/script/{scriptID}/task' endpoint" { - $WithBody = $(New-SmaScriptTask @NewScriptTaskParams -Verbose) 4>&1 - $WithBody | Should -Be 'Performing the operation "POST /api/script/1234/task" on target "https://foo".' + It "Should take parameter from pipeline" { + { 1234 | New-SmaScriptTask -Body @{'foo' = 'foo' } } | Should -Not -Throw + } + + It "Should take parameter from position" { + { New-SmaScriptTask -Id 1234 -Body @{'foo' = 'foo' } } | Should -Not -Throw } } + } } \ No newline at end of file diff --git a/tests/unit/New-SmaServiceDeskTicket.tests.ps1 b/tests/unit/New-SmaServiceDeskTicket.tests.ps1 index 96c26b0..43bdf3a 100644 --- a/tests/unit/New-SmaServiceDeskTicket.tests.ps1 +++ b/tests/unit/New-SmaServiceDeskTicket.tests.ps1 @@ -1,52 +1,36 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'New-SmaServiceDeskTicket Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $Body = @{ - 'Tickets' =@( - @{ - 'title'='test-ticket' - 'hd_queue_id'= 1 - 'submitter' = 1234 - "custom_1" = 'custom field 1 text' - } - ) - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA - $NewTicketParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - Body = $Body - } + - New-SmaServiceDeskTicket @NewTicketParams + It 'should call only New-ApiPOSTRequest' { - It 'should call New-ApiPOSTRequest' { - Assert-MockCalled -CommandName New-ApiPOSTRequest -ModuleName KaceSMA -Times 1 - } + New-SmaServiceDeskTicket -Body @{'foo' = 'foo' } + + Assert-MockCalled -CommandName New-ApiPostRequest -ModuleName KaceSMA -Times 1 - It 'should not call additional HTTP request methods' { - $Methods = @('GET','DELETE','PUT') + $Methods = @('GET', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } + } + + Context 'Parameter input' { + + Mock New-ApiPOSTRequest { } -ModuleName KaceSMA + + It "Should take parameter from pipeline" { + { @{'foo' = 'foo' } | New-SmaServiceDeskTicket } | Should -Not -Throw + } - It "should call '/api/service_desk/tickets' endpoint" { - $WithBody = $(New-SmaServiceDeskTicket @NewTicketParams -Verbose) 4>&1 - $WithBody | Should -Be 'Performing the operation "POST /api/service_desk/tickets" on target "https://foo".' + It "Should take parameter from position" { + { New-SmaServiceDeskTicket -Body @{'foo' = 'foo' } } | Should -Not -Throw } } } diff --git a/tests/unit/Remove-SmaServiceDeskTicket.tests.ps1 b/tests/unit/Remove-SmaServiceDeskTicket.tests.ps1 index 47cdad2..48faf8b 100644 --- a/tests/unit/Remove-SmaServiceDeskTicket.tests.ps1 +++ b/tests/unit/Remove-SmaServiceDeskTicket.tests.ps1 @@ -1,43 +1,21 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Remove-SmaServiceDeskTicket Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $RemoveTicketParams = @{ - Server = 'https://foo' - Credential = $MockCred - TicketID = 1234 - Org = 'Default' - Confirm = $false - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA - Remove-SmaServiceDeskTicket @RemoveTicketParams + It 'should call only New-ApiDeleteRequest' { + Remove-SmaServiceDeskTicket -Id 1234 -Confirm:$false - It 'should call New-ApiDELETERequest' { - Assert-MockCalled -CommandName New-ApiDELETERequest -ModuleName KaceSMA -Times 1 - } + Assert-MockCalled -CommandName New-ApiDeleteRequest -ModuleName KaceSMA -Times 1 - It 'should not call additional HTTP request methods' { - $Methods = @('GET','POST','PUT') + $Methods = @('GET', 'POST', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - - It "should call '/api/service_desk/tickets/1234' endpoint" { - $WithBody = $(Remove-SmaServiceDeskTicket @RemoveTicketParams -Verbose) 4>&1 - $WithBody | Should -Be 'Performing the operation "DELETE /api/service_desk/tickets/1234" on target "https://foo".' - } } } } \ No newline at end of file diff --git a/tests/unit/Set-SmaAsset.tests.ps1 b/tests/unit/Set-SmaAsset.tests.ps1 index 4357b99..2f964ae 100644 --- a/tests/unit/Set-SmaAsset.tests.ps1 +++ b/tests/unit/Set-SmaAsset.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Set-SmaAsset Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,78 +6,34 @@ Describe 'Set-SmaAsset Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $SetAssetBody = @{ - 'Assets' = @( - @{ - 'id' = 7563 - 'field_10149' = 'nwtest2' - } - ) - } - - $AssetIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - AssetID = '1234' - Body = $SetAssetBody - } - - - Set-SmaAsset @AssetIDParams + It 'should call only New-ApiPUTRequest' { + $SetAssetBody = @{'foo' = 'foo' } + $AssetIDParams = @{ + ID = '1234' + Body = $SetAssetBody + } + Set-SmaAsset @AssetIDParams - It 'should call New-ApiPUTRequest' { - Assert-MockCalled -CommandName New-ApiPUTRequest -ModuleName KaceSMA -Times 1 - } + Assert-MockCalled -CommandName New-ApiPutRequest -ModuleName KaceSMA -Times 1 - It 'should not call additional HTTP request methods' { - $Methods = @('POST','DELETE','GET') + $Methods = @('GET', 'DELETE', 'POST') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - It "should call AssetID endpoint" { - $WithAssetID = $(Set-SmaAsset @AssetIDParams -Verbose) 4>&1 - $WithAssetID | Should -Be 'Performing the operation "PUT /api/asset/assets/1234" on target "https://foo".' - } - } - Context 'Function Output' { - Mock New-ApiPUTRequest { - $MockResponse = [pscustomobject]@{'Result'='Success'} - return $MockResponse - } -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + Context 'Parameter input' { - - - It 'should produce [PSCustomObject] output' { - - $SetAssetBody = @{ - 'Assets' = @( - @{ - 'id' = 7563 - 'field_10149' = 'nwtest2' - } - ) - } + Mock New-ApiPUTRequest { } -ModuleName KaceSMA - $AssetIDParams = @{ - Server = 'https://foo' - Credential = $MockCred - Org = 'Default' - AssetID = '1234' - Body = $SetAssetBody - } - - $output = Set-SmaAsset @AssetIDParams + It "Should take parameter from pipeline" { + {1234 | Set-SmaAsset -Body @{'foo' = 'foo' }} | Should -Not -Throw + } - $output | Should -BeOfType PSCustomObject + It "Should take parameter from position" { + {Set-SmaAsset -Id 1234 -Body @{'foo' = 'foo' }} | Should -Not -Throw } } } diff --git a/tests/unit/Set-SmaAssetAsArchived.tests.ps1 b/tests/unit/Set-SmaAssetAsArchived.tests.ps1 index 659e81d..917807d 100644 --- a/tests/unit/Set-SmaAssetAsArchived.tests.ps1 +++ b/tests/unit/Set-SmaAssetAsArchived.tests.ps1 @@ -1,8 +1,3 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Set-SmaAssetAsArchived Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { @@ -11,35 +6,36 @@ Describe 'Set-SmaAssetAsArchived Unit Tests' -Tags 'Unit' { Mock New-ApiPutRequest {} -ModuleName KaceSMA Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $Body = @{ - archiveReason = "Testing Archival via API" - } - - $ArchiveSplat = @{ - Server = 'https://foo' - Org = 'Default' - Credential = $MockCred - AssetId = 1234 - Body = $Body - } - Set-SmaAssetAsArchived @ArchiveSplat + It 'should call only New-ApiPOSTRequest' { + $Body = @{ + archiveReason = "Testing Archival via API" + } + + $ArchiveSplat = @{ + Id = 1234 + Body = $Body + } + Set-SmaAssetAsArchived @ArchiveSplat - It 'should call New-ApiPOSTRequest' { - Assert-MockCalled -CommandName New-ApiPOSTRequest -ModuleName KaceSMA -Times 1 - } + Assert-MockCalled -CommandName New-ApiPostRequest -ModuleName KaceSMA -Times 1 - It 'should not call additional HTTP request methods' { - $Methods = @('GET','DELETE','PUT') + $Methods = @('GET', 'DELETE', 'PUT') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } - It "should call '/api/asset/assets/1234/archive' endpoint" { - $WithBody = $(Set-SmaAssetAsArchived @ArchiveSplat -Verbose) 4>&1 - $WithBody | Should -Be 'Performing the operation "POST /api/asset/assets/1234/archive" on target "https://foo".' + Context 'Parameter input' { + + Mock New-ApiPOSTRequest { } -ModuleName KaceSMA + + It "Should take parameter from pipeline" { + {1234 | Set-SmaAssetAsArchived -Body @{'foo' = 'foo' }} | Should -Not -Throw + } + + It "Should take parameter from position" { + {Set-SmaAssetAsArchived -Body @{'foo' = 'foo' } -Id 1234} | Should -Not -Throw + } } } } diff --git a/tests/unit/Set-SmaMachineInventory.tests.ps1 b/tests/unit/Set-SmaMachineInventory.tests.ps1 index e3be75c..8ddec1b 100644 --- a/tests/unit/Set-SmaMachineInventory.tests.ps1 +++ b/tests/unit/Set-SmaMachineInventory.tests.ps1 @@ -1,51 +1,34 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Set-SmaMachineInventory Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA - - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) - - $Body = @{ - 'Machines' = @( - @{ - 'id' = 1234 - 'notes' = ((Get-Date).tostring()) - } - ) - } + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA - $MachineSplat = @{ - Server = 'https://foo' - Org = 'Default' - Credential = $MockCred - MachineId = 1234 - Body = $Body - } - Set-SmaMachineInventory @MachineSplat + It 'should call only New-ApiPUTRequest' { - It 'should call New-ApiPUTRequest' { - Assert-MockCalled -CommandName New-ApiPUTRequest -ModuleName KaceSMA -Times 1 - } + Set-SmaMachineInventory -Id 1234 -Body @{'foo' = 'foo' } + + Assert-MockCalled -CommandName New-ApiPutRequest -ModuleName KaceSMA -Times 1 - It 'should not call additional HTTP request methods' { - $Methods = @('GET','DELETE','POST') + $Methods = @('GET', 'DELETE', 'POST') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } + } + Context 'Parameter input' { + + Mock New-ApiPUTRequest { } -ModuleName KaceSMA + + It "Should take parameter from pipeline" { + { 1234 | Set-SmaMachineInventory -Body @{'foo' = 'foo' } } | Should -Not -Throw + } - It "should call '/api/inventory/machines/1234' endpoint" { - $WithBody = $(Set-SmaMachineInventory @MachineSplat -Verbose) 4>&1 - $WithBody | Should -Be 'Performing the operation "PUT /api/inventory/machines/1234" on target "https://foo".' + It "Should take parameter from position" { + { Set-SmaMachineInventory -Id 1234 -Body @{'foo' = 'foo' } } | Should -Not -Throw } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/tests/unit/Set-SmaServiceDeskTicket.tests.ps1 b/tests/unit/Set-SmaServiceDeskTicket.tests.ps1 index d26e0af..8ab6ed5 100644 --- a/tests/unit/Set-SmaServiceDeskTicket.tests.ps1 +++ b/tests/unit/Set-SmaServiceDeskTicket.tests.ps1 @@ -1,50 +1,34 @@ -$root = Split-Path (Split-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -Parent) -Parent - -Get-Module KaceSMA | Remove-Module -Force -Import-Module $root\KaceSMA.psd1 - Describe 'Set-SmaServiceDeskTicket Unit Tests' -Tags 'Unit' { InModuleScope KaceSMA { Context 'Backend Calls' { - Mock New-ApiGetRequest {} -ModuleName KaceSMA - Mock New-ApiPostRequest {} -ModuleName KaceSMA - Mock New-ApiPutRequest {} -ModuleName KaceSMA - Mock New-ApiDeleteRequest {} -ModuleName KaceSMA + Mock New-ApiGetRequest { } -ModuleName KaceSMA + Mock New-ApiPostRequest { } -ModuleName KaceSMA + Mock New-ApiPutRequest { } -ModuleName KaceSMA + Mock New-ApiDeleteRequest { } -ModuleName KaceSMA - $MockCred = New-Object System.Management.Automation.PSCredential ('fooUser', (ConvertTo-SecureString 'bar' -AsPlainText -Force)) + It 'should call only New-ApiPUTRequest' { - $Body = @{ - 'Tickets' = @( - @{ - 'custom_1' = "text for custom_1" - 'custom_2' = "text for custom_2" - } - ) - } - - $TicketSplat = @{ - Server = 'https://foo' - Org = 'Default' - Credential = $MockCred - TicketId = 1234 - Body = $Body - } - Set-SmaServiceDeskTicket @TicketSplat + Set-SmaServiceDeskTicket -Id 1234 -Body @{'foo' = 'foo' } - It 'should call New-ApiPUTRequest' { Assert-MockCalled -CommandName New-ApiPUTRequest -ModuleName KaceSMA -Times 1 - } - It 'should not call additional HTTP request methods' { - $Methods = @('GET','DELETE','POST') + $Methods = @('GET', 'DELETE', 'POST') Foreach ($Method in $Methods) { Assert-MockCalled -CommandName ("New-Api$Method" + "Request") -ModuleName KaceSMA -Times 0 } } + } + Context 'Parameter input' { + + Mock New-ApiPUTRequest { } -ModuleName KaceSMA + + It "Should take parameter from pipeline" { + + { 1234 | Set-SmaServiceDeskTicket -Body @{'foo' = 'foo' } } | Should -Not -Throw + } - It "should call '/api/service_desk/tickets/1234' endpoint" { - $WithBody = $(Set-SmaServiceDeskTicket @TicketSplat -Verbose) 4>&1 - $WithBody | Should -Be 'Performing the operation "PUT /api/service_desk/tickets/1234" on target "https://foo".' + It "Should take parameter from position" { + { Set-SmaServiceDeskTicket -Id 1234 -Body @{'foo' = 'foo' } } | Should -Not -Throw } } }