0

I'm trying to execute this commande and i keep getting that the IIS drive was not found, inthe documentation there is IIS:> while i have my local drive, how do I activate it?



enter image description here

I tried importing webAdministration but I don't think thats the problem

  • If I `import webadministration` then I can `set-location IIS:`. Are you running PowerShell as administrator? – TessellatingHeckler Nov 01 '22 at 16:43
  • What you should try is to forget about all previous legacy IIS interfaces in PowerShell and only use `IISAdministration` cmdlets, https://learn.microsoft.com/en-us/powershell/module/iisadministration/?view=windowsserver2022-ps In case a specific function is missing (such as creating new application pools) use `Get-IISServerManager` to get the most powerful `ServerManager` object and start from there. All IIS cmdlets are recommended to execute as administrator as that's how they were designed. – Lex Li Nov 02 '22 at 00:06

1 Answers1

0

When I try to open PowerShell directly and run the script, it prompts: Cannot find drive. A drive with the name 'IIS' does not exist..

image1

But when I reopen PowerShell as administrator and run the command, the problem is solved.

image2

YurongDai
  • 1,362
  • 1
  • 2
  • 7