Powershell Script Run

[Solved] Powershell Script Run | Perl - Code Explorer | yomemimo.com
Question : cmd run powershell script

Answered by : yn7ka

CMD>
C:> powershell -File "C:\Zabbix\hello.ps1"
PS>
cd "C:\Zabbix";
echo 'Write-host "Please enter your name:"' > hello.ps1
echo '$userName = read-host' >> hello.ps1
echo '"Hello $userName!"' >> hello.ps1
type hello.ps1
./hello.ps1
For Error: cannot be loaded because the execution of scripts is disabled on this system, Use:
PS> set-executionpolicy remotesigned

Source : https://www.techotopia.com/index.php/The_Basics_of_Creating_and_Running_Windows_PowerShell_1.0_Scripts | Last Update : Mon, 05 Sep 22

Question : powershell script run

Answered by : thomas-naccari

./myscript.ps1 //if is in the current directory
c:/scripts/myscript.ps1 //if you want to use the full path
&"C:/my path with space/myscript.ps1" //if your path has spaces

Source : | Last Update : Wed, 12 Feb 20

Answers related to powershell script run

Code Explorer Popular Question For Perl