New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Windows 7 machines #15

Closed
dfranciscus opened this Issue Feb 8, 2019 · 7 comments

Comments

Projects
None yet
2 participants
@dfranciscus
Copy link

dfranciscus commented Feb 8, 2019

When I run the command below against Windows 7 machines I am getting this error. I believe this used to happen in an earlier version.

C:\Scripts\PowerShell> invoke-commandas -ComputerName hslllp2 -ScriptBlock {choco list -lo} -AsSystem
The term 'Get-ScheduledTask' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-ScheduledTask
+ PSComputerName : hslllp2

@mkellerman

This comment has been minimized.

Copy link
Owner

mkellerman commented Feb 8, 2019

I'll need a test VM to play with, but try and comment out line:
https://github.com/mkellerman/Invoke-CommandAs/blob/master/Invoke-CommandAs/Private/Invoke-ScheduledTask.ps1#L136

See if it works, and at the same time, make sure that the ScheduledTask get's removed correctly please.

@mkellerman

This comment has been minimized.

Copy link
Owner

mkellerman commented Feb 8, 2019

Created a W2008R2 vm to test with. i think there might be an issue with more lines than just L136, i'll investigate.

@mkellerman mkellerman added the bug label Feb 8, 2019

@dfranciscus

This comment has been minimized.

Copy link
Author

dfranciscus commented Feb 8, 2019

@mkellerman

This comment has been minimized.

Copy link
Owner

mkellerman commented Feb 9, 2019

I got a W2008R2 and a W2012R2 machine for testing.

At the moment, W2008R2 with PSv2.0 fails horribly. I just had to test it.. 🤣
I'm upgrading the VM to run with PSv3.0 now, and will be able to test more in the morning.

I did tones of rework to the script, and did some major stability improvements on W2012R2.

@mkellerman

This comment has been minimized.

Copy link
Owner

mkellerman commented Feb 9, 2019

I'm wondering what is the lowest version of PS I'm trying to support at this point.
What version are you running in your environment?

@mkellerman

This comment has been minimized.

Copy link
Owner

mkellerman commented Feb 9, 2019

Got it to work on Windows Server 2008 R2 + PS3.0

It should work fine on Windows 7, but will need you to test!

@mkellerman

This comment has been minimized.

Copy link
Owner

mkellerman commented Feb 9, 2019

Version 3.1.0 published to PSGallery
Fixed #18

@mkellerman mkellerman closed this Feb 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment