-
Notifications
You must be signed in to change notification settings - Fork 0
/
Prerequisites.ps1
44 lines (43 loc) · 1.01 KB
/
Prerequisites.ps1
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
function InstallNuGet
{
if ((Get-PackageProvider -Name NuGet).version -lt 2.8.5.201 ) {
try {
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Confirm:$False -Force
}
catch [Exception]{
$_.message
exit
}
}
else {
Write-Host "NuGet already installed"
}
}
function InstallPreRequisites
{
if (Get-Module -ListAvailable -Name SteamPS) {
Write-Host "SteamPS already Installed"
}
else {
InstallNuGet
try {
Install-Module -Name SteamPS -AllowClobber -Confirm:$False -Force -Scope CurrentUser
}
catch [Exception] {
$_.message
exit
}
}
}
function WaitEnd
{
Write-Host "Hit any key to continue or wait for 5 secs..."
$counter = 0
while(!$Host.UI.RawUI.KeyAvailable -and ($counter++ -lt 50))
{
Start-Sleep -Milliseconds 100
}
}
# main
InstallPreRequisites
WaitEnd