File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 5
5
[String ] $ModuleName
6
6
)
7
7
8
+ $ErrorActionPreference = " Stop"
9
+
8
10
if (! (Test-Path - PathType Container $PathToModuleFiles )) {
9
11
Write-Error " $PathToModuleFiles not found or is not a directory. Nothing to install."
10
12
exit
Original file line number Diff line number Diff line change 3
3
[String ] $ModuleName
4
4
)
5
5
6
+ $ErrorActionPreference = " Stop"
7
+
8
+
6
9
$moduleRoot = " $ ( $env: CommonProgramW6432 ) \Modules\"
7
10
$dir = " $moduleRoot \$ModuleName \"
8
11
Original file line number Diff line number Diff line change 6
6
7
7
Write-ChocolateySuccess $packageName
8
8
} catch {
9
- Write-ChocolateyFailure $packageName $ ($_.Exception.Message )
9
+ $message = @"
10
+ Uhoh. Looks like $packageName doesn't want to uninstall! But don't worry there is probably a good explanation.
11
+
12
+ It is highly likely that you have an instance of PowerShell running with $packageName loaded.
13
+
14
+ You should probably try closing all instances of PowerShell and rerunning this uninstall from cmd.exe.
15
+ "@
16
+
17
+ Write-Host " ==============================================="
18
+ Write-Host $message
19
+ Write-Host " ==============================================="
10
20
throw
11
21
}
You can’t perform that action at this time.
0 commit comments