mirror of
https://github.com/winapps-org/winapps.git
synced 2025-05-31 04:27:17 +02:00
fix: remove bad escape characters
This commit is contained in:
parent
b1e2107b8f
commit
a78982bda6
@ -1,16 +1,16 @@
|
||||
# Get the current network profile name
|
||||
$currentProfile = ^(Get-NetConnectionProfile^).Name
|
||||
$currentProfile = (Get-NetConnectionProfile).Name
|
||||
|
||||
# Get all profiles from the registry
|
||||
$profilesKey = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles"
|
||||
$profiles = Get-ChildItem -Path $profilesKey
|
||||
|
||||
foreach ^($profile in $profiles^) {
|
||||
foreach ($profile in $profiles) {
|
||||
$profilePath = "$profilesKey\$($profile.PSChildName)"
|
||||
$profileName = ^(Get-ItemProperty -Path $profilePath^).ProfileName
|
||||
$profileName = (Get-ItemProperty -Path $profilePath).ProfileName
|
||||
|
||||
# Remove profiles that don't match the current one
|
||||
if ^($profileName -ne $currentProfile^) {
|
||||
if ($profileName -ne $currentProfile) {
|
||||
Remove-Item -Path $profilePath -Recurse
|
||||
Write-Host "Deleted profile: $profileName"
|
||||
}
|
||||
@ -18,11 +18,11 @@ foreach ^($profile in $profiles^) {
|
||||
|
||||
# Change the current profile name to "WinApps"
|
||||
$profiles = Get-ChildItem -Path $profilesKey
|
||||
foreach ^($profile in $profiles^) {
|
||||
foreach ($profile in $profiles) {
|
||||
$profilePath = "$profilesKey\$($profile.PSChildName)"
|
||||
$profileName = ^(Get-ItemProperty -Path $profilePath^).ProfileName
|
||||
$profileName = (Get-ItemProperty -Path $profilePath).ProfileName
|
||||
|
||||
if ^($profileName -eq $currentProfile^) {
|
||||
if ($profileName -eq $currentProfile) {
|
||||
# Update the profile name
|
||||
Set-ItemProperty -Path $profilePath -Name "ProfileName" -Value "WinApps"
|
||||
Write-Host "Renamed profile to: WinApps"
|
||||
|
Loading…
x
Reference in New Issue
Block a user