1

When I run this PowerShell script

Import-Module WebAdministration
$path1 = Get-ItemProperty -PSPath IIS:\Sites\CompassSvcQA-Red\R4\CompassSettings

Set-Location "C:\Windows\Microsoft.NET\Framework\v4.0.30319"
.\aspnet_regiis.exe -pef "connectionStrings" $path1.physicalPath -prov "DataProtectionConfigurationProvider"

I'm getting this error:

Get-ItemProperty : Cannot find drive. A drive with the name 'IIS' does not exist. At line:2 char:10 + $path1 = Get-ItemProperty -PSPath IIS:\Sites\CompassSvcQA-Red\R4\CompassSettings + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (IIS:String) [Get-ItemProperty], DriveNotFoundException + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
Sagar M
  • 11
  • 1
  • 2
    Possible duplicate of [Getting "Can't find the drive. The drive called 'IIS' does not exist."](https://stackoverflow.com/questions/24392696/getting-cant-find-the-drive-the-drive-called-iis-does-not-exist). Is the module actually installed on your computer? – Ansgar Wiechers Feb 06 '19 at 22:54
  • My web.config file have a different name( lets say settings.config) but the aspnet_regiis.exe only able to encrypt or decrypt from web.config so how to make it encrypt < connectionstring> from my renamed web.config(settings.config) – Sagar M Feb 08 '19 at 17:45

0 Answers0