Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell issue creating IIS directories

$
0
0

Hello,

I am trying to automate using powershell and I am running into a dead end. I have 3 components to my solution.

1. welcome.php - calls the powershell script.

2. Input.html. - user submits a file name.

3. IIS.ps1 - powershell script to create IIS directories, and virtual apps.

I am able to run the script fine in powershell ISE but when I call it from my php page it fails. My php page is simple, see below.


The power shell script I am using is listed below.

Set-StrictMode -Version 2.0

$Site="Default Web Site"

Write-Host ""

Write-Host " " -BackgroundColor DarkCyan

Write-Host " IIS Setup Script " -BackgroundColor DarkCyan

Write-Host " Create Virtual Directories " -BackgroundColor DarkCyan

Write-Host " " -BackgroundColor DarkCyan

Write-Host ""

Import-Module WebAdministration -ErrorAction SilentlyContinue

if (dir IIS:\Sites\$Site) {Write-Host...


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>