-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller-setup.ps1
More file actions
31 lines (23 loc) · 1.02 KB
/
Copy pathinstaller-setup.ps1
File metadata and controls
31 lines (23 loc) · 1.02 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
# set environmental variables
Write-Output "set-Alias -Name hpe -Value $INSTALLLOC\hpe.ps1" >> $PROFILE
# Setup VM Name dynamically
#install vcxsrv
# Add profile to windows terminal
# $env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
# Define the new profile
$newProfile = @{
"commandline" = "powershell.exe -command `"Path\to\Hyper-V-Enhanced>hpe.ps1`""
"elevate" = $false
"hidden" = $false
"name" = "Kali"
}
# Convert the profile to a JSON string
$newProfileJson = $newProfile | ConvertTo-Json -Depth 100
# Get the path to the Windows Terminal settings file
$settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"
# Load the current settings
$settings = Get-Content -Path $settingsPath -Raw | ConvertFrom-Json -Depth 100
# Add the new profile to the list of profiles
$settings.profiles.list += $newProfileJson | ConvertFrom-Json -Depth 100
# Save the updated settings
$settings | ConvertTo-Json -Depth 100 | Set-Content -Path $settingsPath