Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

cmd run powershell script

CMD>
C:> powershell -File "C:abbixhello.ps1"




PS>
cd "C:abbix";
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 by www.techotopia.com #
 
PREVIOUS NEXT
Tagged: #cmd #run #powershell #script
ADD COMMENT
Topic
Name
9+5 =