Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7033403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:03:42+00:00 2026-05-28T01:03:42+00:00

I have the following script. Get-Job | ? { $_.State -eq ‘Completed’ } |

  • 0

I have the following script.

Get-Job | ? { $_.State -eq 'Completed' } | Remove-Job

I want to display the removed jobs in one chained pipes. The following script doesn’t work.

 Get-Job | ? { $_.State -eq 'Completed' } | Remove-Job | % { echo "Removed: $_" }

And the following get errors.

 Get-Job | ? { $_.State -eq 'Completed' } | % { echo "Removed: $_" } | Remove-Job

Remove-Job : The input object cannot be bound to any parameters for
the command either because t he command does not take pipeline input
or the input and its properties do not match any of the parameters
that take pipeline input. At line:2 char:81
+ Get-Job | ? { $.State -eq ‘Completed’ } | % { echo “Removed: $” } | Remove-Job <<<<
+ CategoryInfo : InvalidArgument: (Removed: System…n.PSRemotingJob:PSObject) [Re move-Job],
ParameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Commands.RemoveJobComman
d

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:03:43+00:00Added an answer on May 28, 2026 at 1:03 am

    You can do like this to keep it simple:

    get-job | ?{$_.state -eq "Completed"} | 
      %{ Remove-Job $_; Write-host "Removed $($_.Name)" }
    

    For what you were trying to work, you have to do:

    get-job | ?{$_.state -eq "Completed"}  | %{write-host "Removed: $($_.Name)"; $_} | 
       Remove-Job
    

    Note the $_, passing the job back to the pipeline.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Nant Script snippet. <zip zipfile=${devEnvironment}..\dev-${datetime::get-year(datetime::now())}${datetime::get-month(datetime::now())}${datetime::get-day(datetime::now())}.zip> <fileset basedir=${devEnvironment}> <include name=**/*/> </fileset>
I have a PHP script that does the following: Uses file_get_contents() to get content
I have a php script which is doing the following job. $unTarCommand = 'tar
I have the following script: $('#divs').children().each( function(){ //Get Id's var id = $(this).attr('id').replace('id_',''); alert(id);
I have the following script. The created background job never finishes. (It finishes in
I have written the following script to get the value of hidden field to
I have the following script that I want the production guys to execute using
I have the following script: #!/bin/sh r=3 r=$((r+5)) echo r However, I get this
I have the following script. It replaces all instances of @lookFor with @replaceWith in
I have the following script, where the first and third document.writeline are static and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.