Last active
August 29, 2025 18:21
-
-
Save nohwnd/5c07fe62c861ee563f69c9ee1f7c9688 to your computer and use it in GitHub Desktop.
Revisions
-
nohwnd revised this gist
Apr 11, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ function Uninstall-Pester ([switch]$All) { #Requires -RunAsAdministrator $pesterPaths = foreach ($programFiles in ($env:ProgramFiles, ${env:ProgramFiles(x86)})) { $path = "$programFiles\WindowsPowerShell\Modules\Pester" if ($null -ne $programFiles -and (Test-Path $path)) { if ($All) { Get-Item $path -
nohwnd revised this gist
Apr 11, 2020 . 2 changed files with 35 additions and 23 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #Requires -RunAsAdministrator function Uninstall-Pester ([switch]$All) { if ([IntPtr]::Size * 8 -ne 64) { throw "Run this script from 64bit PowerShell." } #Requires -RunAsAdministrator $pesterPaths = foreach ($programFiles in ($env:ProgramFiles, ${env:ProgramFiles(x86)})) { $path = "$programFiles\$suffix\WindowsPowerShell\Modules\Pester" if ($null -ne $programFiles -and (Test-Path $path)) { if ($All) { Get-Item $path } else { Get-ChildItem "$path\3.*" } } } if (-not $pesterPaths) { "There are no Pester$(if (-not $all) {" 3"}) installations in Program Files and Program Files (x86) doing nothing." return } foreach ($pesterPath in $pesterPaths) { takeown /F $pesterPath /A /R icacls $pesterPath /reset # grant permissions to Administrators group, but use SID to do # it because it is localized on non-us installations of Windows icacls $pesterPath /grant "*S-1-5-32-544:F" /inheritance:d /T Remove-Item -Path $pesterPath -Recurse -Force -Confirm:$false } } Uninstall-Pester This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,23 +0,0 @@ -
nohwnd revised this gist
Apr 11, 2020 . 2 changed files with 23 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #Requires -RunAsAdministrator $pesterPaths = foreach ($programFiles in ($env:ProgramFiles, ${env:ProgramFiles(x86)})) { $path = "$programFiles\$suffix\WindowsPowerShell\Modules\Pester" if ($null -ne $programFiles -and (Test-Path $path)) { Get-ChildItem "$path\3.*" } } if (-not $pesterPaths) { "There are no Pester 3 installations in Program Files and Program Files (x86) doing nothing." continue } foreach ($pesterPath in $pesterPaths) { takeown /F $pesterPath /A /R icacls $pesterPath /reset # grant permissions to Administrators group, but use SID to do # it because it is localized on non-us installations of Windows icacls $pesterPath /grant "*S-1-5-32-544:F" /inheritance:d /T Remove-Item -Path $pesterPath -Recurse -Force -Confirm:$false } -
nohwnd revised this gist
Dec 8, 2019 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,5 +8,7 @@ if (-not (Test-Path $modulePath)) { takeown /F $modulePath /A /R icacls $modulePath /reset # grant permissions to Administrators group, but use SID to do # it because it is localized on non-us installations of Windows icacls $modulePath /grant "*S-1-5-32-544:F" /inheritance:d /T Remove-Item -Path $modulePath -Recurse -Force -Confirm:$false -
nohwnd revised this gist
Dec 11, 2018 . No changes.There are no files selected for viewing
-
nohwnd created this gist
Dec 9, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ #Requires -RunAsAdministrator $modulePath = "C:\Program Files\WindowsPowerShell\Modules\Pester" if (-not (Test-Path $modulePath)) { "There is no Pester folder in $modulePath, doing nothing." break } takeown /F $modulePath /A /R icacls $modulePath /reset icacls $modulePath /grant Administrators:'F' /inheritance:d /T Remove-Item -Path $modulePath -Recurse -Force -Confirm:$false