PowerShell is a powerful command-line shell and scripting language that is widely used for automation and administration tasks in the…