четверг, 8 июня 2023 г.

Dynamic menu script to run other scripts

 # Get scripts in a folder, create a GUI menu and run the chosen script

# "Path_To_Scripts_Directory\" - it's not where this launching script is located, it's where the bunch of scripts you want to create the menu from is.

$PathToScripts = "Path_To_Scripts_Directory\"

$FilesInPath = $PathToScripts+"*"

# get a list of scripts/files

$Scripts = Get-ChildItem -File $FilesInPath | sort Name

# choosing the script for run 

$SelectedScript = $Scripts.Name | OGV -Title "Menu" -PassThru

$FullPathToScript = $PathToScripts+$SelectedScript

# launching selected script

& $FullPathToScript

Комментариев нет:

Отправить комментарий