Improved user output when clearing start menu

This commit is contained in:
Raphire
2023-09-12 02:59:25 +02:00
parent 74e40e7b38
commit d93cbfd377

View File

@@ -126,6 +126,9 @@ function ClearStartMenu {
# Check if bin file exists
if(Test-Path $startmenuBinFile) {
Copy-Item -Path $startmenuTemplate -Destination $startmenu -Force
$cpyMsg = "Replaced start menu for user " + $startmenu.Fullname.Split("\")[2]
Write-Output $cpyMsg
}
else {
# Bin file doesn't exist, indicating the user is not running the correct version of windows. Exit function
@@ -141,11 +144,13 @@ function ClearStartMenu {
# Create folder if it doesn't exist
if(-not(Test-Path $defaultProfile)) {
new-item $defaultProfile -ItemType Directory -Force
new-item $defaultProfile -ItemType Directory -Force | Out-Null
Write-Output "Created LocalState folder for default user"
}
# Copy template to default profile
Copy-Item -Path $startmenuTemplate -Destination $defaultProfile -Force
Write-Output "Copied start menu template to default user folder"
}