Cannot send commands via the Azure Portal "RunPowerShellScript" feature

Anonymous
2020-12-09T03:22:40.123+00:00

Trying to run a simple command such as "start "https://www.youtube.com" does nothing on my Windows 10 VM. I ran the "EnableRemotePS" command in the portal and inside the VM. When running the command inside the VM, it outputs this:

New-NetFirewallRule : Cannot create a file when that file already exists.
At line:2 char:1

  • New-NetFirewallRule -Name "Allow WinRM HTTPS" -DisplayName "WinRM HTT ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : ResourceExists: (MSFT_NetFirewallRule:root/standardcimv2/MSFT_NetFirewallRule) [New-NetFirewallRule], CimException
  • FullyQualifiedErrorId : Windows System Error 183,New-NetFirewallRule

WSManFault
Message
ProviderFault
WSManFault
Message = The WS-Management service cannot perform the configuration operation. A listener with Address=* and Transport=HTTPS configuration already exists. You have to delete the existing listener first in order to be able to create it with the same Address and Transport values.

Error number: -2144108493 0x80338033
The WS-Management service cannot create the resource because it already exists.

I've spoken with support and they told me to try "Enable-PSRemoting -Name 'RobbertPC' -ResourceGroupName 'DOOTDOOTDOOT' -Protocol https -OsType Windows" and i get the error of:

Enable-PSRemoting : A parameter cannot be found that matches parameter name 'Name'.
At line:1 char:19

  • Enable-PSRemoting -Name 'RobbertPC' -ResourceGroupName 'DOOTDOOTDOOT' ...
  • ~~~~~
  • CategoryInfo : InvalidArgument: (:) [Enable-PSRemoting], ParameterBindingException
  • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.EnablePSRemotingCommand

I am not sure where to go from here

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.