Compare commits
No commits in common. "9a6b91f3ed01d456ba09df96a0e4f469848adf22" and "4e18db759e4e9b1d11098788c43c7fd5b2bbd190" have entirely different histories.
9a6b91f3ed
...
4e18db759e
@ -1,19 +0,0 @@
|
||||
# NinjaOne Automation Scripts
|
||||
|
||||
## Install-NinjaOneRmm
|
||||
|
||||
Install NinjaRMM
|
||||
|
||||
Download and install the NinjaOne RMM agent with the given token.
|
||||
|
||||
### Parameters
|
||||
|
||||
#### -Token
|
||||
|
||||
Specifies the token ID of the Organization Location in which to place the agent once it is installed.
|
||||
|
||||
### Examples
|
||||
|
||||
```powershell
|
||||
.\Install-NinjaRmm.ps1 -Token '90a92722-da34-452c-99e0-af8be7fcbf0c'
|
||||
```
|
||||
@ -1,67 +0,0 @@
|
||||
Describe 'Install-IPerf3' {
|
||||
BeforeAll {
|
||||
Set-Item function:Install-IPerf3 ([ScriptBlock]::Create((Get-Content -Raw 'windows\Install-iPerf3.ps1')))
|
||||
}
|
||||
|
||||
It 'Has the correct parameters' {
|
||||
$params = (Get-Command Install-iPerf3).Parameters
|
||||
|
||||
$params.ContainsKey('DestinationPath') | Should -Be $true
|
||||
$params['DestinationPath'].ParameterType.Name | Should -Be 'String'
|
||||
|
||||
$params.ContainsKey('ServerService') | Should -Be $true
|
||||
$params['ServerService'].ParameterType.Name | Should -Be 'SwitchParameter'
|
||||
}
|
||||
|
||||
Context 'Without ServerService parameter' {
|
||||
It 'Should download and install iPerf3 without errors' {
|
||||
{ Install-iPerf3 -DestinationPath 'C:\Program Files\iPerf3' } | Should -Not -Throw
|
||||
}
|
||||
|
||||
It 'Should add iPerf3 to the system PATH' {
|
||||
$env:PATH | Should -Match 'C:\\Program Files\\iPerf3\\'
|
||||
}
|
||||
|
||||
It 'Should create the iPerf3 installation directory' {
|
||||
Test-Path -Path 'C:\Program Files\iPerf3' | Should -Be $true
|
||||
}
|
||||
|
||||
It 'Should create the iPerf3 executable in the installation directory' {
|
||||
Test-Path -Path 'C:\Program Files\iPerf3\iperf3.exe' | Should -Be $true
|
||||
}
|
||||
|
||||
It 'Should add a firewall rule for iPerf3' {
|
||||
$firewallRule = Get-NetFirewallRule -DisplayName 'Allow iPerf3' -ErrorAction SilentlyContinue
|
||||
$firewallRule | Should -Not -Be $null
|
||||
}
|
||||
|
||||
AfterAll {
|
||||
# Clean up any existing iPerf3 installation
|
||||
if (Get-Service -Name iperf3server -ErrorAction SilentlyContinue) {
|
||||
Stop-Service -Name iperf3server -Force
|
||||
Remove-Service -Name iperf3server
|
||||
}
|
||||
Remove-Item -Path 'C:\Program Files\iPerf3' -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-NetFirewallRule -DisplayName 'Allow iPerf3' -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
Context 'With ServerService parameter' {
|
||||
It 'Should install iPerf3 as a Windows service when ServerService is specified' {
|
||||
{ Install-iPerf3 -DestinationPath 'C:\Program Files\iPerf3' -ServerService } | Should -Not -Throw
|
||||
$service = Get-Service -Name iperf3server -ErrorAction SilentlyContinue
|
||||
$service | Should -Not -Be $null
|
||||
$service.Status | Should -Be 'Running'
|
||||
}
|
||||
|
||||
AfterAll {
|
||||
# Clean up any existing iPerf3 installation
|
||||
if (Get-Service -Name iperf3server -ErrorAction SilentlyContinue) {
|
||||
Stop-Service -Name iperf3server -Force
|
||||
Remove-Service -Name iperf3server
|
||||
}
|
||||
Remove-Item -Path 'C:\Program Files\iPerf3' -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-NetFirewallRule -DisplayName 'Allow iPerf3' -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user