Created by: DarwinJS
@SteveL-MSFT - I have replaced the winrm calls with the code you suggested.
Do you have any thoughts on disable-psremoting?
- Is it necessary if enable-psremoting was used to open up the box or are the two winrm commands sufficient to undo enable-psremoting ?
I found the source fo disable-psremoting and it looks to be actually doing deny ACLs rather than return to a pristine state - can you confirm my observations? : https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs#L5253
Also in the source for enable-psremoting there are permissions changes - are these reversed by
winrm invoke restore or are the relevant objects removed? Or are these acls left as residue?
Thanks for any commentary you can provide.