Run Powershell script from a batch file

Save file as <filename>.cmd
 avatar
unknown
powershell
3 years ago
235 B
5
Indexable
<# :
  @echo off
    powershell /nologo /noprofile /command ^
         "&{[ScriptBlock]::Create((cat """%~f0""") -join [Char[]]10).Invoke(@(&{$args}%*))}"
  exit /b
#>
Write-Host Hello, $args[0] -fo Green
#Your program here...
Editor is loading...