Skip to content
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

Add '-UseSSL' Parameter #23

Closed
adilio opened this issue Feb 12, 2019 · 4 comments
Closed

Add '-UseSSL' Parameter #23

adilio opened this issue Feb 12, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@adilio
Copy link

adilio commented Feb 12, 2019

In our Production environment, we have set winrm quickconfig -transport:https, in order to only enable the HTTPS WSMan listener (cert-based transport).

As such, when running, Invoke-Command, we must specify the -UseSSL parameter.

It would be awesome if we could also use a similar -UseSSL parameter in Invoke-CommandAs, as well.

Currently, we can do the following:

$Sess = New-PSSession -ComputerName FQDN.ubc.ca  -UseSSL
Invoke-CommandAs -Session $Sess -ScriptBlock { Get-Process } -AsSystem

This would just mean one less step on instantiating the PSSession.

Merci beaucoup!

@mkellerman mkellerman added the enhancement New feature or request label Feb 16, 2019
@mkellerman
Copy link
Owner

I've just pushed the changes to master. Can you pull a copy from GitHub and test? I'm now replicating ALL parameters from Invoke-Command.

@adilio
Copy link
Author

adilio commented Feb 17, 2019

It works!

Tested on:

  • Windows 10 1809
  • Windows Server 2019

Side-note: I did get the error:

Invoke-CommandAs : A parameter cannot be found that matches parameter name 'RunElevated'.

Works fine when I remove that parameter. Is -RunElevated now deprecated, or just not needed with -AsSystem?

@mkellerman
Copy link
Owner

Yeah, Im running all commands as elevated. :/

No sure if that parameter is ever NOT going to be used.

What are your thoughts?

@adilio
Copy link
Author

adilio commented Feb 17, 2019

Makes sense to me, running as elevated is kinda the whole point of the module.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants