You want to rewrite an old batch file (.bat) into PowerShell. If you ask an AI, it will generate a plausible script in a few minutes.However, after rewriting, it often happens that "it runs, but the ...