The Azure CLI has a --no-wait command
Is there an identical command in powerShell?
The Azure CLI has a --no-wait command
Is there an identical command in powerShell?
Hello @GiladGershon-6057,
As far as I am aware there is no such parameter built in. Normally what I do in my scripts is to run that line as a "job" so it will run in a different session and my main script can continue.
steps:
1. Save the line(s) you don't want to wait for in a PS1
2. change the line in your script for: Start-Job -FilePath <path\filename.ps1>
Hope this resolves your query,
Best regards,
Hello @GiladGershon-6057 ,
just be aware: If you use Start-Job and you end the PowerShell session the started job will be terminated as well. No matter if the job is finished or not.
Using Invoke-Command with -InDisconnectedSession will start a "disconnected/independant" PowerShell session which will run until it finished.
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten
Hi @GiladGershon-6057 ,
using Invoke-Command with the -InDisconnectedSession option might be what you are looking for:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/invoke-command?view=powershell-7.1
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten
What I'm looking for is not to write a script, but to run command after command.
for example:
Run command to delete Resource Group in PowerShell, and move on without waiting for the deletion to end.
17 people are following this question.