vscode中使用powershell报错解决方案

Vscode中报错 CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate’.

以及

win10、win11使用WindowsPowershell 碰到 “无法加载文件 xx.ps1,因为在此系统上禁止运行脚本。

第一步:在VScode powershell comdline中执行conda init后重启vscode,出现错误无法加载文件******.ps1,因为在此系统中禁止执行脚本,这是这个信息可以先不管进行下一步就行。
如: conda init cmd.exe
conda init powershell

第二步:通过Win10 开始菜单进入PowerShell(管理员)or win11搜索power shell 在使用管理员执行 ,输入命令set-ExecutionPolicy RemoteSigned,这是在输入一个y点回车确定执行命令就行。