I'm trying to use IIS administration commandlets such as Get-IISSite on a Windows Server 2012 R2 computer.
I've already installed IIS Server and all IIS Management Tools roles and rebooted the server.
However, when I open a PS commandline as administrator, the commandlets are still missing:
PS C:\Users\Administrator> get-command *iis*
CommandType Name ModuleName
----------- ---- ----------
Function IIS: WebAdministration
Application iisreset.exe
PS C:\Users\Administrator>
What am I doing wrong?
Edit: One thing I've also already tried (without any luck):
PS C:\Users\Administrator> Import-Module webadministration
PS C:\Users\Administrator> get-command *iis*
CommandType Name ModuleName
----------- ---- ----------
Function IIS: webadministration
Application iisreset.exe
PS C:\Users\Administrator>
As jScott correctly remarked in the comments, Get-IISSite ist not included in Windows-Server 2012 R2, but only in later Windows Server versions and in Windows 10 or higher.
Import-Module WebAdministration; (Get-Module WebAdministration).ExportedCommands
is very similar and works under Windows Server 2012 R2 though.