MicrosoftDocs/windows-powershell-docs

.AssSslCertificate method not available in WebAdministration module

womackn opened this issue · 1 comments

When running the command listed in the article:

New-WebBinding -Name "Default Web Site" -IPAddress "*" -Port 443 -HostHeader "TestSite" -Protocol "https"
(Get-WebBinding -Name "Default Web Site" -Port 443 -Protocol "https").AddSslCertificate("a909502dd82ae41433e6f83886b00d4277a32a7b", "my")

The following error is received:

Method invocation failed because [Deserialized.Microsoft.IIs.PowerShell.Framework.ConfigurationElement#bindings#binding] does not contain a method named 'AddSslCertificate'.

Possibly related to an issue when importing the WebAdministration module before running the commands:

Import-Module WebAdministration

receives the warning:

WARNING: Module WebAdministration is loaded in Windows PowerShell using WinPSCompatSession remoting session; please note that all input and output of commands from this module will be deserialized
objects. If you want to load this module into PowerShell please use 'Import-Module -SkipEditionCheck' syntax.

Running "Import-Module WebAdministration -SkipEditionCheck" returns error:

Import-Module: Could not load type 'System.Management.Automation.PSSnapIn' from assembly 'System.Management.Automation, Version=7.2.8.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

No further information is available.

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

This repository is for PowerShell core documentation. You seem to be looking for support, which we can't provide here.

I suggest you try posting your issue with context in one of the available community support forums.