Run Multiple Powershell Scripts Using a Checklist

IT PROJECTS

11/20/20241 min read

Need to run multiple Powershell scripts in one single window? Use the function below to run many different Powershell scripts from one single plane of glass.

  1. Create a folder on your C: drive called 'Scripts'

  2. Move all the Powershell scripts you want to run into this folder

  3. Copy the script below into a new Powershell ISE window, change the options in the 'Write-Host' areas to match your script names.

  4. Save the script in the same folder as the others, the script doesn't have to be run as administrator.

  5. Running the script in Powershell ISE is preferred. Enjoy!

function Show-Menu

{

param (

[string]$Title = 'My Checklist'

)

Clear-Host

Write-host "================ $Title ================"

Write-host "===================================================="

#CHANGE THE OPTIONS FOR WHAT YOUR SITE NEEDS

Write-Host "Running scripts with Powershell ISE is preferred"

Write-Host "1. Run 'Daily Health Check'"

Write-Host "2. Run 'Backup Status'"

Write-Host "3. Run 'Find Recent Updates'"

Write-Host "4. Run 'Check SSL Certificate Status'"

Write-Host "5. Run 'Auto Rename Files'"

Write-Host "6. Run 'Auto Copy Files'"

Write-Host "7. Run 'Find Serial Numbers'"

Write-Host "8. Run 'Remove Backups'"

Write-Host "9. Run 'Remove Files'"

Write-Host "10. Run 'Rename Files'"

Write-Host "Press 'Q' to quit'"

}

do

{

Show-Menu -Title 'My Checklist'

$selection = Read-Host "Make a selection"

switch ($selection)

{

'1' {

'You chose option 1,'

& ((Split-Path $MyInvocation.InvocationName) + ".\Daily Health Check.ps1")

} '2' {

'You chose option 2,'

& ((Split-Path $MyInvocation.InvocationName) + ".\Backup Status.ps1")

} '3' {

'You chose option 3,'

& ((Split-Path $MyInvocation.InvocationName) + ".\Find Recent Updates.ps1")

} '4' {

'You chose option 4,'

& ((Split-Path $MyInvocation.InvocationName) + ".\Check SSL Certificate Status.ps1")

} '5' {

'You chose option 5,'

& ((Split-Path $MyInvocation.InvocationName) + ".\Auto Rename Files.ps1")

} '6' {

'You chose option 6,'

& ((Split-Path $MyInvocation.InvocationName) + "Auto Copy Files.ps1")

} '7' {

'You chose option 7,'

& ((Split-Path $MyInvocation.InvocationName) + ".\Find Serial Numbers.ps1")

} '8' {

'You chose option 8,'

& ((Split-Path $MyInvocation.InvocationName) + ".\Remove Backups.ps1")

} '9' {

'You chose option 9,'

& ((Split-Path $MyInvocation.InvocationName) + ".\Remove Files.ps1")

} '10' {

'You chose option 10,'

& ((Split-Path $MyInvocation.InvocationName) + ".\Rename Files.ps1")

}

}

}

until ($selection -eq 'q')

Related Stories