如何将 Powershell 重置为默认设置?

Whi*_*uit 7 powershell

我更改了许多 powershell 策略,例如运行脚本的执行策略。有没有办法让一切恢复到安装操作系统时的默认设置?

小智 5

有一个 PowerShell 配置文件,通常C:\Users\UserA\Documents\WindowsPowerShell您可以在其中编辑/删除一些自定义条目。

当谈到“重置服务”时,这可能可以手动完成。

例如执行策略

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Undefined
Run Code Online (Sandbox Code Playgroud)

此外,检查C:\Users\UserA\Documents\PowerShell\powershell.config.json您实际上可以从那里更改执行策略