Test-Connection google.com -count 10 -AsJob

Manish Chawda 426 Reputation points
2021-06-28T09:48:58.773+00:00

Hi,

When I am executing the following command, the -As job is not working in Powershell Core 7.0

Similarly Get-Job | Receive-Job also does not respond.

Test-Connection google.com -count 10 -AsJob

Kindly advise

Manish

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,345 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,386 Reputation points Microsoft Vendor
    2021-06-28T13:25:40.06+00:00

    Hi,

    The -AsJob parameter is not available for the Test-Connection cmdelt in PowerShell Core 7. You can create a background job using Start-Job.

    Start-Job -Name job1 -ScriptBlock {Test-Connection google.com -Count 10}  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful