-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstallMe.ps1
More file actions
89 lines (74 loc) · 3.14 KB
/
Copy pathInstallMe.ps1
File metadata and controls
89 lines (74 loc) · 3.14 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# ------------------------------------------------- Information -------------------------------------------------
# Title - Security PC Automator
# Author - Vincent Walker
# Date - 28/04/2023
# ------------------------------------------------- Parameters -------------------------------------------------
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[ValidateSet("All","Standard","Minimal","Pentest","Developer")]
[string]$PackageSet,
[Parameter(Mandatory=$false)]
[ValidateSet("Setup")]
[string]$VM,
[Parameter(Mandatory=$false)]
[switch]$Uninstall
)
# ------------------------------------------------- PackagesSets -------------------------------------------------
$PackageSets = @{
"All" = @("Standard","Minimal","Pentest","Developer")
"Pentest" = @("Standard","Wireshark","nmap", "advanced-ip-scanner","burp-suite-free-edition")
"Developer" = @("python3", "nano", "filezilla", "gns3", "sysinternals", "winscp", "putty","winmerge","vscode")
"Standard" = @("Minimal","virtualbox","vmwareworkstation","notepad++","vlc" )
"Minimal" = @("googlechrome", "7zip","adobereader" )
}
if ($PackageSet -ne "Minimal") {
$PackageList = $PackageSets.Values | ForEach-Object {$_}
}
else {
$PackageList = $PackageSets[$PackageSet]
}
# ------------------------------------------------- Install Chocolatey -------------------------------------------------
## Change Directory to User Profile
Set-Location $env:USERPROFILE\Documents
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned -Force
## Install Required Applications
if (-not (Test-Path "C:\ProgramData\chocolatey\bin\choco.exe")) {
$script = New-Object Net.WebClient
$script.DownloadString("https://chocolatey.org/install.ps1")
Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression
## Upgrade Choco
choco upgrade chocolatey
choco feature enable -n allowGlobalConfirmation
}
# ------------------------------------------------- Install Python -------------------------------------------------
# Upgrade Python
python -m pip install --upgrade pip
# ------------------------------------------------- Chocolatey Main Code -------------------------------------------------
# Loop over the package names and install or uninstall each package
if ($Uninstall) {
Write-Host "Uninstalling packages:"
foreach ($package in $PackageList)
{
if (choco list -localonly | Select-String -SimpleMatch $package) {
Write-Host "- $package"
choco uninstall $package -y
} else {
Write-Warning "$package is not installed."
}
}
} else {
Write-Host "Installing packages:"
foreach ($package in $PackageList)
{
if (choco list -localonly | Select-String -SimpleMatch $package) {
Write-Host "- $package"
} else {
Write-Host "- $package (not installed)"
}
choco install $package -y
}
}
# ------------------------------------------------- Install VMware PowerCLI -------------------------------------------------
if (-not (Test-Path "C:\Users\Vinnie\Documents\WindowsPowerShell\Modules\VMware.PowerCLI.Sdk")) {
}