0

I should start off by stressing that I have very, very little experience in PowerShell, so apologies if this is user error.

After copying the commands over from https://learn.microsoft.com/en-us/troubleshoot/developer/browsers/administration/k-12-assessments-reports-apps-background I keep hitting Unexpected Token errors on step 4. This is the code, along with the errors:

$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\PreLaunch\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" $Name = "Enabled" $value = "0" New-Item -Path $registryPath -Force | Out-Null New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null At line:1 char:138

  • ... ch\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" $Name = "Enab ...
  •                                                         ~~~~~
    

Unexpected token '$Name' in expression or statement. At line:1 char:156

  • ... oftEdge_8wekyb3d8bbwe!MicrosoftEdge" $Name = "Enabled" $value = "0" N ...
  •                                                        ~~~~~~
    

Unexpected token '$value' in expression or statement. At line:1 char:169

  • ... d8bbwe!MicrosoftEdge" $Name = "Enabled" $value = "0" New-Item -Path $ ...
  •                                                      ~~~~~~~~
    

Unexpected token 'New-Item' in expression or statement. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : UnexpectedToken

I've tried messing around with a few things and have gotten rid of some, but not all of the errors. Any help would be greatly appreacited!

qkh17
  • 1

1 Answers1

2

Sample formatting on that documentation article is broken, it's hiding a couple of linebreaks:

$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\PreLaunch\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge"
$Name = "Enabled"
$value = "0"
New-Item -Path $registryPath -Force | Out-Null
New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null
Mathias R. Jessen
  • 157,619
  • 12
  • 148
  • 206