powershell
PS C:\> choco upgrade powershell-core
Chocolatey v0.10.8
Upgrading the following packages:
powershell-core
By upgrading you accept licenses for the packages.
powershell-core v6.0.2 is the latest version available based on your source(s).
Chocolatey upgraded 0/1 packages.
See the log for details (C:\ProgramData\chocoportable\logs\chocolatey.log).
PS C:\>
PS C:\> $env:path += ";C:\ProgramData\chocoportable"
PS C:\> choco install notepadplusplus -y
Chocolatey v0.10.8
[Pending] Removing incomplete install for 'notepadplusplus'
Installing the following packages:
notepadplusplus
By installing you accept licenses for the packages.
notepadplusplus.install v7.5.6 [Approved]
notepadplusplus.install package files install completed. Performing ot
her installation steps.
Installing 64-bit notepadplusplus.install...
notepadplusplus.install has been installed.
notepadplusplus.install installed to 'C:\Program Files\Notepad++'
Added C:\ProgramData\chocoportable\bin\notepad++.exe shim pointed to '
c:\program files\notepad++\notepad++.exe'.
notepadplusplus.install may be able to be automatically uninstalled.
The install of notepadplusplus.install was successful.
Software installed as 'exe', install location is likely default.
notepadplusplus v7.5.6 [Approved]
notepadplusplus package files install completed. Performing other inst
allation steps.
The install of notepadplusplus was successful.
Software install location not explicitly set, could be in package or
default install location if installer.
Chocolatey installed 2/2 packages.
See the log for details (C:\ProgramData\chocoportable\logs\chocolatey
.log).
PS C:\>
当 Chocolatey 完成安装 Notepad++ 的安装后,只需要按下 Win + R 键,然后在“运行”对话框中输入
当您从 internet 下载了一个文件,它可能会被 Windows 标记(通过 NTFS 流),并且 PowerShell 可能会拒绝执行它:
1 2 3 4 5 6 7 8 9
PS> & "$home\desktop\Rick.ps1" & : File C:\Users\tobwe\desktop\Rick.ps1 cannot be loaded. The file C:\Users\tobwe\desktop\Rick.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:3 + & "$home\desktop\Rick.ps1" + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess