-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMSI-Extractor-InstallScript.ps1
More file actions
29 lines (24 loc) · 1022 Bytes
/
MSI-Extractor-InstallScript.ps1
File metadata and controls
29 lines (24 loc) · 1022 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
26
27
28
29
# =================================== #
# Simple MSI Extractor install script #
# kernaltrap #
# Version 1.3 #
# =================================== #
$ImportMSIExtractor = "`nImport-Module $HOME\Documents\PowerShell\Modules\MSI-Extractor.ps1"
$MSIExtractorPath = "$PSScriptRoot/MSI-Extractor.ps1"
if (!(Test-Path -Path $ProfilePath)) {
mkdir $HOME\Documents\PowerShell\Modules | Out-Null
}
if (!(Test-Path -Path $PROFILE.CurrentUserAllHosts)) {
New-Item -Type File -Path $PROFILE.CurrentUserAllHosts -Force
}
if (!(Test-Path -Path $MSIExtractorPath)) {
Throw "MSI-Extractor script is not present in this directory!"
} else {
Copy-Item $PSScriptRoot\MSI-Extractor.ps1 -Destination $HOME\Documents\PowerShell\Modules
}
if (!(Test-Path -Path $ProfilePath)) {
Throw "Cannot find Powershell profile script!"
} else {
Write-Output $ImportMSIExtractor > $PROFILE.CurrentUserAllHosts
Write-Host "All tests passed, MSI-Extractor is installed."
}