GithubHelp home page GithubHelp logo

Nothing happens about invoke-commandas HOT 5 CLOSED

mkellerman avatar mkellerman commented on September 26, 2024
Nothing happens

from invoke-commandas.

Comments (5)

mkellerman avatar mkellerman commented on September 26, 2024

Can you provide more info:

-OS
-PSVersion
-example of code to reproduce the error
-command line use and parameters

from invoke-commandas.

Gobiman avatar Gobiman commented on September 26, 2024

Hi
OS= Win2016 (works locally but not remotely), running as admin on both systems
PSVersion= 5.1.14393.2363
Invoke-CommandAs -ComputerName 'ServerName' -ScriptBlock { Get-Process }
The output
PS C:\local> $Error
Get-Job : The command cannot find the job because the job name 47621e7f-6d1f-4265-b011-05eb16fe8705 was not found.
Verify the value of the Name parameter, and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\2.0\Invoke-CommandAs.psm1:208 char:36

  • ... -Not($Job = Get-Job -Name $ScheduledJob.Name -ErrorAction SilentlyCon ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (47621e7f-6d1f-4265-b011-05eb16fe8705:String) [Get-Job], PSArgumentExcep
      tion
    • FullyQualifiedErrorId : JobWithSpecifiedNameNotFound,Microsoft.PowerShell.Commands.GetJobCommand

Get-Job : The command cannot find the job because the job name 47621e7f-6d1f-4265-b011-05eb16fe8705 was not found.
Verify the value of the Name parameter, and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\2.0\Invoke-CommandAs.psm1:208 char:36

  • ... -Not($Job = Get-Job -Name $ScheduledJob.Name -ErrorAction SilentlyCon ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (47621e7f-6d1f-4265-b011-05eb16fe8705:String) [Get-Job], PSArgumentExcep
      tion
    • FullyQualifiedErrorId : JobWithSpecifiedNameNotFound,Microsoft.PowerShell.Commands.GetJobCommand

Thanks

from invoke-commandas.

mkellerman avatar mkellerman commented on September 26, 2024

Please provide a -Credential when executing against a remote machine.

from invoke-commandas.

mkellerman avatar mkellerman commented on September 26, 2024

Did this resolve your issue?

Also, try establishing a New-PSSession, and use that instead of ComputerName/Credential. Just to help debug.

Will close this issue until further notice.

from invoke-commandas.

mkellerman avatar mkellerman commented on September 26, 2024

I fixed some issues in latest release (3.0), maybe worth retesting!

from invoke-commandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.