-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProxy.psm1
More file actions
49 lines (39 loc) · 1.33 KB
/
Proxy.psm1
File metadata and controls
49 lines (39 loc) · 1.33 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Set-StrictMode -Version 2.0
Function Install-SimpleInstallScriptsProxies {
param(
[Parameter(Mandatory)] [string] $SiteFolder
)
Write-Host "Installing Simple Install Scripts Proxies"
Copy-Item -Path "$PSScriptRoot\SimpleInstallScripts*.asmx" -Destination $SiteFolder
}
Function Remove-SimpleInstallScriptsProxies {
param(
[Parameter(Mandatory)] [string] $SiteFolder
)
Write-Host "Deleting Simple Install Scripts Proxy"
$installerPath = Join-Path $SiteFolder "SimpleInstallScripts*.asmx"
Remove-Item -Path $installerPath -ErrorAction SilentlyContinue
}
Function Test-Site {
param([Parameter(Mandatory)][string] $Url)
Write-Host "Pinging $Url" -ForegroundColor Magenta
$test = Invoke-WebRequest -Uri $url -TimeoutSec 600 -UseBasicParsing
$test.Content | Out-Null
}
Function Invoke-WaitForJobsToFinish {
param(
[Parameter(Mandatory)][string] $Name,
[Parameter(Mandatory)] $proxy
)
$jobsRunning = $true
Write-Host "Waiting for $Name to finish" -ForegroundColor Yellow
while ($jobsRunning) {
$jobsRunning = $proxy.AreJobsRunning()
Write-Host "." -NoNewline
if ($jobsRunning) {
Start-Sleep 5
} else {
Write-Host " done"
}
}
}