Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't run the 'dir' or 'Get-ChildItem" command from IIS:\ in powershell
    primarykey
    data
    text
    <p>I'm trying to automate some web application deployment tasks so I'm attempting to use powershell to accomplish this. I have a powershell script and a .bat file. The batch file is just there to execute the powershell script and contains this text. I'm on Windows 8 - 64bit.</p> <pre><code>C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "&amp; '%~dp0\SetupWebServer.ps1' %* </code></pre> <p>I have some code in the powershell script that runs these commands:</p> <pre><code>Write-Host "Check for the existence of the Application Pool." Import-Module WebAdministration $iisAppPoolName = "SiteName" $iisAppPoolDotNetVersion = "v4.0" $iisAppName = "SiteName" cd IIS:\AppPools\ if (!(Test-Path $iisAppPoolName -PathType Container)) { Write-Host "Creating Application Pool" } </code></pre> <p>When I get to the CD IIS:\AppPools\ command I get the following error:</p> <pre><code>cd : Retrieving the COM class factory for component with CLSID {688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). At line:1 char:1 + cd IIS:\AppPools\ + ~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Set-Location], COMException + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.PowerShell.Commands.SetLocationCommand </code></pre> <p>From a separate powershell prompt, I can cd to IIS:\, but I can't run the dir command and get a similar error. What am I missing? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload