I am trying to use the powershell command for recycling file/folder.
The following script had worked for me, as a file, and called indirectly through powershell.exe by other applications.
PS C:\WINDOWS\system32> $sh = new-object -comobject "Shell.Application"
PS C:\WINDOWS\system32> $ns = $sh.Namespace(0).ParseName("C:\New folder\test")
PS C:\WINDOWS\system32> $ns.InvokeVerb("delete")
But after applying update 22H2 (the only change I've made to my computer), the command .InvokeVerb("delete") would be stuck frozen. There is no error code. How should I start debugging on what is wrong and then fix it?