How to Create a PowerShell Script File

How to Create a PowerShell Script File

Channel:
Subscribers:
12,900
Published on ● Video Link: https://www.youtube.com/watch?v=yj4aqwcKuCE



Category:
Tutorial
Duration: 8:41
37,070 views
226


█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█
[Instructions]
[Using notepad]

Go to Search and type in "notepad", and save it as all files .ps1
[Using Powershell ISE]
Go to Search and type in Powershell, and look for "Powershell ISE".
Type in the commands you want, like

Write-Host "Hello World" , and save it as all files name.ps1 .
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[Output Script]

Write-Host "Hello World"
Read-Host "Press any key to continue"
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Run Powershell Command Prompt as administrator to run Powershell Script Files
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
When you are in Powershell Command Prompt

Set-ExecutionPolicy RemoteSigned

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[Output and Input Script]

$Name = Read-Host -Prompt 'What is your name?'
$Age = Read-Host -Prompt "What is your age?'
Write-Host "Your name is '$Name' and your age is '$Age'"
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█