if not in interactive, check a script was passed

This commit is contained in:
2025-12-16 16:45:15 +00:00
parent eb3af982da
commit be58d6a9e5
2 changed files with 8 additions and 2 deletions

View File

@@ -54,6 +54,10 @@ function main {
read-hostuntilempty -vmr $vmr
return
}
if ($script.Count -eq 0) {
'No script provided, exiting' | Write-Host
return
}
$script | ForEach-Object {
msgHandler -vmr $vmr -line $_
}