windows_baseline icon indicating copy to clipboard operation
windows_baseline copied to clipboard

64位Windows7下运行windows.ps1报错

Open greendow opened this issue 3 years ago • 0 comments

你好!在64位Windows7下运行windows.ps1报错: PS C:\github_files\windows_baseline> .\windows.ps1 赋值表达式无效。赋值运算符的左侧需为可赋值给变量或属性等的内容。 所在位置 C:\github_files\windows_baseline\windows.ps1:48 字符: 41 $config_line = $config[$i] -split "= <<<< " CategoryInfo : ParserError: (:) [], ParseException FullyQualifiedErrorId : InvalidLeftHandSide

按照网页上的说明,使用Notepad++将windows.ps1文件的编码改为UTF-8 BOM,再次运行,还是报错: PS C:\github_files\windows_baseline> .\windows.ps1 无法对空数组进行索引。 所在位置 C:\github_files\windows_baseline\windows.ps1:6 字符: 27 $PSDefaultParameterValues[ <<<< 'Out-File:Encoding'] = 'utf8' CategoryInfo : InvalidOperation: (Out-File:Encoding:String) [], RuntimeException FullyQualifiedErrorId : NullArray

Get-ItemProperty : 找不到路径“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer”,因为该 路径不存在。 所在位置 C:\github_files\windows_baseline\windows.ps1:587 字符: 29 $config = (Get-ItemProperty <<<< -Path "Registry::$Key" -ErrorAction Stop).$name CategoryInfo : ObjectNotFound: (HKEY_CURRENT_US...licies\Explorer:String) [Get-ItemProperty], ItemNotFoundException FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand 请问应该如何处理?还望不吝赐教,谢谢!

greendow avatar Aug 10 '22 02:08 greendow