Fix broken query

This commit is contained in:
Manuel Thalmann 2023-06-30 04:26:19 +02:00
parent a122795f38
commit fa0a0356a4

View file

@ -52,7 +52,7 @@ function New-PersonalUser([Context] $context)
{
Enable-PersonalUserAutologon $context;
Write-Information "Removing Admin Account";
Get-CimInstance -ClassName "Win32_UserProfile" -Filter "SID = $((Get-LocalUser $context.AdminName).SID)" | Remove-CimInstance;
Get-CimInstance -ClassName "Win32_UserProfile" -Filter "SID = '$((Get-LocalUser $context.AdminName).SID)'" | Remove-CimInstance;
$context.RegisterReboot();
$context.RemoveStage();
Write-EventLog -LogName Application -Source "Application" -EventId $context.Get($uacDisablerTriggerProperty) -Message "This event was created by $env:Username";