-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathWebDeploy-Installer.ps1
More file actions
25 lines (22 loc) · 1000 Bytes
/
WebDeploy-Installer.ps1
File metadata and controls
25 lines (22 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#============================================================================
# Web Deploy Installer
#============================================================================
# Filename: WebDeploy-Installer.ps1
#
# Purpose: Install Web Deploy ZIP package to local IIS SharePoint site
# given two parameters ZIP file and IIS website name.
#============================================================================
param (
[string]$zip, # example "c:\temp\HelloTime.zip"
[string]$iisWebSiteName # example "Portal"
)
# Plugin
Import-Module WebAdministration -ErrorAction SilentlyContinue | Out-Null
Add-PSSnapin WDeploySnapIn3.0 -ErrorAction SilentlyContinue | Out-Null
# IIS Virtual Directory
New-WebVirtualDirectory -Name "_webapi" -PhysicalPath "c:\inetpub\webapi\" -Site $iisWebSiteName
# Web Deploy ZIP
$file = Split-Path $zip -Leaf
$params = Get-WDParameters $zip
$params."IIS Web Application Name" = "_webapi/$file"
Restore-WDPackage -Package $zip -Paramters $params