发表于 2018-9-2 14:02:08

powershell-无法加载文件,因为在此系统中禁止执行脚本

写了一个powershell脚本测试脚本,结果执行的时候报错  

  
$a=Get-Content C:\script.txt | select-string -pattern "ora"
  

  
    if ( $a -eq$null )
  

  
    {
  

  
      write-host "error"
  
    }
  

  
    else
  
   {
  
         write-host "OK"
  
    }
  

  
PS D:\> .\pshell.ps1
  
无法加载文件 D:\pshell.ps1,因为在此系统中禁止执行脚本。有关详细信息,请参阅 "get-help about_signing"。
  
所在位置 行:1 字符: 13
  
+ .\pshell.ps1
页: [1]
查看完整版本: powershell-无法加载文件,因为在此系统中禁止执行脚本