Executing another Powershell script

To execute another ps file, just type the ps file name.

Write-Output "Running test1.ps...."
Write-Output ""

# method #1 - run the hardcoded script file
#
#    .\test1.ps1
#
# method #2 - run the script file name stored in a variable.

$ps_file = "$PSScriptRoot\test1.ps1"

& $ps_file

Comments

Popular posts from this blog

Scheduled task in Windows Task Scheduler - part 3

Create scheduled task in Windows Task Scheduler

Get all website entries in IIS