Run PowerShell command from command prompt (no ps1 script)

前端 未结 4 1554
花落未央
花落未央 2020-12-12 22:17

I\'m looking for a way to run just a couple PowerShell commands from the command prompt. I don\'t want to create a script for this since it\'s just a couple commands I need

4条回答
  •  醉话见心
    2020-12-12 22:46

    Run it on a single command line like so:

    powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile 
      -WindowStyle Hidden -Command "Get-AppLockerFileInformation -Directory  
      -Recurse -FileType "
    

提交回复
热议问题