Commit b9240e1 1 parent ffa3666 commit b9240e1 Copy full SHA for b9240e1
File tree 8 files changed +29
-126
lines changed
chocolatey.tests.integration/context/badpackage
8 files changed +29
-126
lines changed Original file line number Diff line number Diff line change @@ -57,13 +57,6 @@ These functions call other functions and many times may be the only thing you ne
57
57
* [Install-ChocolateyPowershellCommand](xref:install-chocolateypowershellcommand)
58
58
* [Install-ChocolateyVsixPackage](xref:install-chocolateyvsixpackage)
59
59
60
- ## Error / Success Functions
61
-
62
- * [Write-ChocolateySuccess](xref:write-chocolateysuccess) - **DEPRECATED**
63
- * [Write-ChocolateyFailure](xref:write-chocolateyfailure) - **DEPRECATED**
64
-
65
- You really don't need a try catch with Chocolatey PowerShell files anymore.
66
-
67
60
## More Functions
68
61
69
62
### Administrative Access Functions
@@ -86,7 +79,6 @@ These are the functions from above as one list.
86
79
87
80
* [Install-ChocolateyZipPackage](xref:install-chocolateyzippackage)
88
81
* [Install-ChocolateyPowershellCommand](xref:install-chocolateypowershellcommand)
89
- * [Write-ChocolateySuccess](xref:write-chocolateysuccess)
90
82
* [Write-ChocolateyFailure](xref:write-chocolateyfailure)
91
83
* [Get-ChocolateyWebFile](xref:get-chocolateywebfile)
92
84
* [Get-ChocolateyUnzip](xref:get-chocolateyunzip)
Original file line number Diff line number Diff line change 86
86
<EmbeddedResource Include =" helpers\functions\UnInstall-ChocolateyZipPackage.ps1" />
87
87
<EmbeddedResource Include =" helpers\functions\Update-SessionEnvironment.ps1" />
88
88
<EmbeddedResource Include =" helpers\functions\Write-ChocolateyFailure.ps1" />
89
- <EmbeddedResource Include =" helpers\functions\Write-ChocolateySuccess.ps1" />
90
89
<EmbeddedResource Include =" redirects\choco.exe.ignore" />
91
90
<EmbeddedResource Include =" redirects\chocolatey.exe.ignore" />
92
91
<EmbeddedResource Include =" redirects\cinst.exe.ignore" />
Original file line number Diff line number Diff line change @@ -43,9 +43,6 @@ The message to throw an error with.
43
43
44
44
. PARAMETER IgnoredArguments
45
45
Allows splatting with arguments that do not apply. Do not use directly.
46
-
47
- . LINK
48
- Write-ChocolateySuccess
49
46
#>
50
47
param (
51
48
[string ] $packageName ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
$toolsDir = " $ ( Split-Path - parent $MyInvocation.MyCommand.Definition ) "
2
2
3
- try {
4
- " simple file" | Out-File " $toolsDir \simplefile.txt" - force
3
+ " simple file" | Out-File " $toolsDir \simplefile.txt" - force
5
4
6
- Write-Output " This is $packageName v$packageVersion being installed to `n '$packageFolder '."
7
- Write-Host " PowerShell Version is '$ ( $PSVersionTable.PSVersion ) ' and CLR Version is '$ ( $PSVersionTable.CLRVersion ) '."
8
- Write-Host " Execution Policy is '$ ( Get-ExecutionPolicy ) '."
9
- Write-Host " PSScriptRoot is '$PSScriptRoot '."
10
- Write-Debug " A debug message."
11
- Write-Verbose " Yo!"
12
- Write-Warning " A warning!"
13
- Write-Error " Oh no! An error"
14
- throw " We had an error captain!"
15
-
16
- Write-ChocolateySuccess " $packageName "
17
- } catch {
18
- Write-ChocolateyFailure " $packageName " " $ ( $_.Exception.Message ) "
19
- throw
20
- }
5
+ Write-Output " This is $packageName v$packageVersion being installed to `n '$packageFolder '."
6
+ Write-Host " PowerShell Version is '$ ( $PSVersionTable.PSVersion ) ' and CLR Version is '$ ( $PSVersionTable.CLRVersion ) '."
7
+ Write-Host " Execution Policy is '$ ( Get-ExecutionPolicy ) '."
8
+ Write-Host " PSScriptRoot is '$PSScriptRoot '."
9
+ Write-Debug " A debug message."
10
+ Write-Verbose " Yo!"
11
+ Write-Warning " A warning!"
12
+ Write-Error " Oh no! An error"
13
+ throw " We had an error captain!"
Original file line number Diff line number Diff line change 1
1
$packageName = ' badpackage'
2
2
3
- try {
4
-
5
- Write-Host " Ya!"
6
- Write-Debug " A debug message"
7
- Write-Warning " A warning!"
8
- Write-Error " Oh no! An error"
9
- throw " We had an error captain!"
10
-
11
- Write-ChocolateySuccess " $packageName "
12
- } catch {
13
- Write-ChocolateyFailure " $packageName " " $ ( $_.Exception.Message ) "
14
- throw
15
- }
3
+ Write-Host " Ya!"
4
+ Write-Debug " A debug message"
5
+ Write-Warning " A warning!"
6
+ Write-Error " Oh no! An error"
7
+ throw " We had an error captain!"
Original file line number Diff line number Diff line change 1
- try {
2
-
3
- Write-Output " This is $packageName v$packageVersion being installed to `n '$packageFolder '."
4
- Write-Host " PowerShell Version is '$ ( $PSVersionTable.PSVersion ) ' and CLR Version is '$ ( $PSVersionTable.CLRVersion ) '."
5
- Write-Host " Execution Policy is '$ ( Get-ExecutionPolicy ) '."
6
- Write-Host " PSScriptRoot is '$PSScriptRoot '."
7
- Write-Debug " A debug message."
8
- Write-Verbose " Yo!"
9
- Write-Warning " A warning!"
10
- Write-Error " Oh no! An error"
11
- throw " We had an error captain!"
12
-
13
- Write-ChocolateySuccess " $packageName "
14
- } catch {
15
- Write-ChocolateyFailure " $packageName " " $ ( $_.Exception.Message ) "
16
- throw
17
- }
1
+ Write-Output " This is $packageName v$packageVersion being installed to `n '$packageFolder '."
2
+ Write-Host " PowerShell Version is '$ ( $PSVersionTable.PSVersion ) ' and CLR Version is '$ ( $PSVersionTable.CLRVersion ) '."
3
+ Write-Host " Execution Policy is '$ ( Get-ExecutionPolicy ) '."
4
+ Write-Host " PSScriptRoot is '$PSScriptRoot '."
5
+ Write-Debug " A debug message."
6
+ Write-Verbose " Yo!"
7
+ Write-Warning " A warning!"
8
+ Write-Error " Oh no! An error"
9
+ throw " We had an error captain!"
Original file line number Diff line number Diff line change 1
1
$packageName = ' badpackage'
2
2
3
- try {
4
-
5
- Write-Host " Ya!"
6
- Write-Debug " A debug message"
7
- Write-Warning " A warning!"
8
- Write-Error " Oh no! An error"
9
- throw " We had an error captain!"
10
-
11
- Write-ChocolateySuccess " $packageName "
12
- } catch {
13
- Write-ChocolateyFailure " $packageName " " $ ( $_.Exception.Message ) "
14
- throw
15
- }
3
+ Write-Host " Ya!"
4
+ Write-Debug " A debug message"
5
+ Write-Warning " A warning!"
6
+ Write-Error " Oh no! An error"
7
+ throw " We had an error captain!"
You can’t perform that action at this time.
0 commit comments