Conversation
|
@vexx32 would this be something that you could rebase onto the develop branch, so that we could see if we could get this pulled into the 2.5.0 release? |
|
Mmmm. Complicated. I'll have a stab at a rebase, it'll be manual though, too much has changed in this script since I think. |
cc4cc5c to
ebfa25e
Compare
|
@gep13 I've rebased this as best I can I think. I haven't had time to get it tested today to validate I've not re-broken anything, I'll have a look at that tomorrow. EDIT: I think this is good now? |
4101fbf to
000d30d
Compare
mwallner
left a comment
There was a problem hiding this comment.
see comments, otherwise lgtm
| @@ -345,28 +392,30 @@ function Ensure-Permissions { | |||
There was a problem hiding this comment.
I guess this should be $Path instead of $folder ?
| $null = Remove-Item $Path | ||
|
|
||
| foreach ($file in "$Path.ignore", "$Path.old") { | ||
| Remove-Item $file |
There was a problem hiding this comment.
remove without Test-Path => maybe explicitly SilentlyContinue ?
|
|
||
| Write-Debug "Initialize-Directory" | ||
| if (-not (Test-Path $Path)) { | ||
| New-Item -Path $Path -ItemType Directory | Out-Null |
There was a problem hiding this comment.
-Type if PowerShell v2 compat is a thing
There was a problem hiding this comment.
We haven't had to worry about that AFAIK since Win7 is now completely out of support.
This script has barely been touched in the last decade, in part because it's difficult to follow. Gave it a much needed revision to remove unnecessary clutter, make its code patterns more consistent, and be much more sensible in how it declares and calls commands, so that we can be much more confident that things are working how we expect them to. This should help make it much easier to make changes to going forward, should we ever need to.
000d30d to
cb6ffdb
Compare
|
I think I've addressed all the comments here, thanks! ^^ |
Description Of Changes
Motivation and Context
This script has barely been touched in the last decade, in part because it's difficult to follow. Gave it a much needed revision to remove unnecessary clutter, make its code patterns more consistent, and be much more sensible in how it declares and calls commands, so that we can be much more confident that things are working how we expect them to.
This should help make it much easier to make changes to going forward, should we ever need to.
Testing
Tests were performed on Win11, Server 2019, and Server 2008R2
install.ps1script we provide on chocolatey.org, providing the-ChocolateyDownloadUrlto point at the locally-built nupkg.chocolateyInstall.ps1due to Many Issues trying to make that script work on that ancient OS (mostly TLS issues I didn't wanna take the time to sort out).C:\ProgramData\chocolateyfolder, then install v2.0 or v2.1 of Chocolatey CLI, then do achoco upgrade --pre -s localfolder/with the built nupkg inlocalfolderOperating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #3255