Publish-20240919-105900/PowerPAN/Public/Device/Test-PanDevice.ps1
function Test-PanDevice { <# .SYNOPSIS Test the API accessibility of a PanDevice. .DESCRIPTION Test the API accessibility of a PanDevice. .NOTES .INPUTS PanDevice[] You can pipe a PanDevice to this cmdlet .OUTPUTS PanResponse .EXAMPLE #> [CmdletBinding()] param( [parameter( Mandatory=$true, Position=0, ValueFromPipeline=$true, HelpMessage='PanDevice(s) to be tested')] [PanDevice[]] $Device ) Begin { # Propagate -Debug and -Verbose to this module function, https://tinyurl.com/y5dcbb34 if($PSBoundParameters.Debug) { $DebugPreference = 'Continue' } if($PSBoundParameters.Verbose) { $VerbosePreference = 'Continue' } # Announce Write-Debug ($MyInvocation.MyCommand.Name + ':') # Initialize PanDeviceDb Initialize-PanDeviceDb } # Begin block Process { foreach($DeviceCur in $Device) { Invoke-PanXApi -Device $DeviceCur -Version } # foreach } # Process block End { } # End block } # Function |