The PowerShell install instructions advise the user to run Set-ExecutionPolicy manually, then do it for them anyway
- Dominant language
- MDX
- Stars
- 223
- Forks
- 248
- Avg merge
- 1d 26m
- Merged PRs (30d)
- 4
Description
## What New Or Updated Would You Like To See?
The [instructions for installing Chocolatey via PowerShell](https://docs.chocolatey.org/en-us/choco/setup#install-with-powershell.exe) currently read:
> #### Install with PowerShell.exe
> With PowerShell, there is an additional step. You must ensure [Get-ExecutionPolicy](https://go.microsoft.com/fwlink/?LinkID=135170) is not `Restricted`. We suggest using `Bypass` to bypass the policy to get things installed or `AllSigned` for quite a bit more security.
>
> * Run `Get-ExecutionPolicy`. If it returns `Restricted`, then run `Set-ExecutionPolicy AllSigned` or `Set-ExecutionPolicy Bypass -Scope Process`.
> * Now run the following command:
>
> ```ps1
> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
> ```
That first bullet point is rendered entirely moot by the inclusion of that same command in the second bullet's prepared command line. The first step should be removed.
## Why Is It Needed?
It's redundant, pointless, and for some users probably confusing, to tell them to explicitly run a command manually, only to include the same command in the copy-paste commandline they're provided with immediately after.
## Additional Context?
IMHO it's _entirely_ appropriate for the install instructions to provide an **explanation** of what `Set-ExecutionPolicy` does, what the different forms mean and their implications, and why it needs to be used when installing Chocolatey. The user should have a full understanding of any commands they're being asked to run, even by copy-paste. (Especially by copy-paste!)
So, the notes about using `Get-ExecutionPolicy` to check the status, or potentially using `AllSigned` as the policy instead of `Bypass`, are all worthwhile content to be included in the instructions. But since that information would be an optional, "further reading"-type discussion (digression, really, for users who are already familiar with the execution policy features), rather than a required step in the install process, it should be contextualized appropriately.
Because once the decision has been made to include `Set-ExecutionPolicy Bypass -Scope Process` as part of the copy-paste install command, explicitly _instructing_ the user to first manually run the exact same command for themselves (a totally unnecessary step) is just wasting their time.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.