Get-Content .\a.txt
dir
      • “Get-Content .\a.txt”:获取当前目录中a.txt的文件内容并回显,Powershell脚本
      • "dir": 打印当前目录中的文件列表,DOS脚本
      • 保存文件为“a.ps1”:ps1为Powershell的保存文件格式

 

  • 执行Powershell
    • 进入Powershell
    • Powershell-入门
    • 进入"a.ps1"的本机存放目录
    • Powershell-入门
    • 输入“.\a.ps1”,回车
    • Powershell-入门
    • 脚本执行成功
  • 问题
    • 执行过程中出现:PSSecurityException
      • Set-ExecutionPolicy UnRestricted

相关文章:

  • 2021-08-07
  • 2021-06-27
  • 2022-12-23
  • 2022-01-07
  • 2022-03-03
  • 2021-05-24
  • 2022-12-23
猜你喜欢
  • 2021-07-25
  • 2021-08-31
  • 2021-10-19
相关资源
相似解决方案