In Azure CLI there is a --no-wait command there is identical command on PowerShell?

Gilad Gershon 21 Reputation points
2021-09-20T06:05:27.17+00:00

The Azure CLI has a --no-wait command
Is there an identical command in powerShell?

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,363 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 39,351 Reputation points
    2021-09-20T09:41:20.597+00:00

    Hello @Gilad Gershon ,

    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,

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Andreas Baumgarten 96,361 Reputation points MVP
    2021-09-20T06:14:26.723+00:00

    Hi @Gilad Gershon ,

    using Invoke-Command with the -InDisconnectedSession option might be what you are looking for:
    https://learn.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