我在安装npm install ng-factory
时遇到了问题。我在NPM
社区中问,他们说这是ASLR
的git问题。因此,我发现此命令将git .exe
文件添加到Windows ASLR
禁用的文件中:
Get-Item -Path "C:\Program Files\Git\usr\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disa >> ble ForceRelocateImages }
但是结果是:
Set-ProcessMitigation : Multiple matches found.
At line:1 char:58
+ ... *.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disa >> ble ForceRel ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (sh.exe:String) [Set-ProcessMitigation], InvalidOperationException
+ FullyQualifiedErrorId : Multiple mitigation policies found that may match the given process name. Please specify
the full path to be matched instead.,Microsoft.Samples.PowerShell.Commands.SetProcessMitigationsCommand
我该如何解决?
编辑: 我尝试了以下命令:
Get-Item -Path "C:\Program Files\Git\usr\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }
但是仍然给我这个错误信息:
Set-ProcessMitigation : Multiple matches found.
At line:1 char:58
+ ... *.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (sh.exe:String) [Set-ProcessMitigation], InvalidOperationException
+ FullyQualifiedErrorId : Multiple mitigation policies found that may match the given process name. Please specify
the full path to be matched instead.,Microsoft.Samples.PowerShell.Commands.SetProcessMitigationsCommand
答案 0 :(得分:1)
不确定从哪里获得脚本
# THIS SHOULDN'T BE HERE ||||
Set-ProcessMitigation -Name $_.Name -Disa >> ble ForceRelocateImages
应该是:
Set-ProcessMitigation -Name $_.FullName -Disable ForceRelocateImages
编辑:根据评论将Name
更改为FullName