gwblok / garytown

GaryTown Scripts, Downloads, Etc
232 stars 71 forks source link

CVE-2023-24932-CI-Remediation.ps1 - Copy-Item throws "Illegal characters in path" on Windows 11 #10

Closed inz- closed 1 year ago

inz- commented 1 year ago

When running the script on Windows 11, The Copy-Item command throws "Illegal Characters in path" image

Lycky commented 1 year ago

the EFI is not mounted and cant be written to. Still strange that it works in Win10 and not Win11. You could do a get-childitem to $SystemVolume.Path and get results in Win10, but same error in Win11. A workaround to this is either to use mountvol (not powershell) or you add the partition access to EFI, with "Add-PartitionAccessPath". Use the $SystemParition variable to add the partition access.

image

gwblok commented 1 year ago

Try using VSCode instead of ISE. I've had issues with ISE and Windows 11 on specific things (this being one of them). However, the code works when running via ConfigMgr or Intune.

For manual Testing, I'd recommend VSCode

gwblok commented 1 year ago

Fails in ISE, but works fine in VSCode

image

gwblok commented 1 year ago

This is an ISE issue.
The code works fine, but in Windows 11, there is an issue that ISE sometimes fails to run code where it used to work fine on Windows 10. For Windows 11 testing, please use VSCode.

gwblok commented 1 year ago

Looking at this a bit more, using @Lycky's idea to add a drive letter. I was hoping to avoid that, but I think it's the best way to make it work universally.... will be releasing an update hopefully later today

gwblok commented 1 year ago

Updates to Proactive Remediation Scripts appear to have resolved the issue in my tests. Please let me know if you continue to have any issues image