Run Powershell script from a batch file

Save file as <filename>.cmd
mail@pastecode.io avatar
unknown
powershell
3 years ago
235 B
2
Indexable
Never
<# :
  @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...