diff --git a/Samples/PowerShell/PowerOrion/PowerOrion.psd1 b/Samples/PowerShell/PowerOrion/PowerOrion.psd1 index ab6ea56e2..04663dddc 100644 Binary files a/Samples/PowerShell/PowerOrion/PowerOrion.psd1 and b/Samples/PowerShell/PowerOrion/PowerOrion.psd1 differ diff --git a/Samples/PowerShell/PowerOrion/PowerOrion.psm1 b/Samples/PowerShell/PowerOrion/PowerOrion.psm1 index 9b6ad86a3..a335c28db 100644 --- a/Samples/PowerShell/PowerOrion/PowerOrion.psm1 +++ b/Samples/PowerShell/PowerOrion/PowerOrion.psm1 @@ -483,10 +483,10 @@ function New-OrionPollerType If passed the -custom switch it can return .EXAMPLE - PS C:\Scripts\Modules\Orion> Get-OrionNodeProperties -NodeID $nodeid -SwisConnection $swis -OrionServer $OrionServer + PS C:\Scripts\Modules\Orion> Get-OrionNodeProperties -NodeID $nodeid -SwisConnection $swis .EXAMPLE - PS C:\Scripts\Modules\Orion> Get-OrionNodeProperties -NodeID $nodeid -SwisConnection $swis -OrionServer $OrionServer -custom + PS C:\Scripts\Modules\Orion> Get-OrionNodeProperties -NodeID $nodeid -SwisConnection $swis -custom Key Value --- ----- @@ -519,11 +519,11 @@ function Get-OrionNode Parametersetname="IP")] [String]$IPAddress, - #Orion Server Name + <# #Orion Server Name [parameter(mandatory=$true)] [validatenotnullorempty()] [string] - $OrionServer="localhost", + $OrionServer="localhost", #> #SolarWinds Information Service (SWIS) Connection [parameter(mandatory=$true)] @@ -539,6 +539,8 @@ function Get-OrionNode Begin { + $OrionServer = $SwisConnection.ChannelFactory.Endpoint.Address.Uri.Host + if($IPAddress){ write-debug "$(Get-TimeStamp) The value of "IPAddress" is $IPAddress" write-verbose "$(Get-TimeStamp) IP passed, calling Get-OrionNodeID for $IPAddress" @@ -749,12 +751,13 @@ function Remove-OrionNode [Alias("IP")] [String]$IPAddress, + <# #Orion Server Name [parameter(mandatory=$true)] [validatenotnullorempty()] [string] $OrionServer, - + #> #SolarWinds Information Service (SWIS) Connection [parameter(mandatory=$true)] [validatenotnullorempty()] @@ -764,6 +767,8 @@ function Remove-OrionNode Begin { + $OrionServer = $SwisConnection.ChannelFactory.Endpoint.Address.Uri.Host + write-verbose "$(Get-TimeStamp) Calling Remove-OrionNode..." #First get the node ID, either implicitly, or explicitly if ($NodeName){ diff --git a/Samples/PowerShell/PowerOrion/Test-PowerOrion.ps1 b/Samples/PowerShell/PowerOrion/Test-PowerOrion.ps1 deleted file mode 100644 index 4069e7601..000000000 --- a/Samples/PowerShell/PowerOrion/Test-PowerOrion.ps1 +++ /dev/null @@ -1,34 +0,0 @@ -#Module Name -$modulename = "PowerOrion" -#Display -Verbose by default -#$VerbosePreference ="continue" -$VerbosePreference ="silentlycontinue" - -$TestNode="10.160.5.58" - -$OrionServer ="10.160.5.75" - -cls - -#perform a clean load of the module -if(Get-Module -Name $modulename){ - Remove-Module -Name PowerOrion -Force -} -Import-Module .\PowerOrion.psm1 - -$swis = Connect-Swis -UserName admin -Password "" -Hostname 10.160.5.75 -$cred = get-OrionWMICredential -SwisConnection $swis | where-Object {$_.Name -like "Local Admin 2"} - Get-OrionWMICredential -SwisConnection $swis - -Get-OrionNodeID -all -SwisConnection $swis - Get-OrionNode -NodeID 3 -SwisConnection $swis -OrionServer $OrionServer -Verbose - - -New-OrionNode -SwisConnection $swis -IPAddress $TestNode -ObjectSubType SNMPv2 -Remove-OrionNode 92 -OrionServer $OrionServer -SwisConnection $swis -Verbose - -$nodes | select nodeid | Get-orionNode -SwisConnection $swis -OrionServer $OrionServer - -New-OrionNode -SwisConnection $swis -ObjectSubType WMI -IPAddress $TestNode -CredentialID $cred.id -Verbose - -New-OrionNode -SwisConnection $swis -ObjectSubType \ No newline at end of file