Functions/Open-NewWindowsinstallScript.ps1
function Open-NewWindowsinstallScript { [CmdletBinding()] param ( ) $ScriptLoc = "$(Split-Path (Get-Module JaapsTools).path)\scripts\New-Windowsinstall.ps1" $PreferredApps = @( # "C:\Program Files\Microsoft VS Code\Code.exe" "C:\Program Files\Notepad++\notepad++.exe" ) foreach ($app in $PreferredApps) { if (Test-Path $app) { Start-Process $app -ArgumentList $ScriptLoc $AppFound = $true break } } if (!($AppFound)) { notepad.exe $ScriptLoc } } |