About 404,000 results
Open links in new tab
  1. windows - How to run a PowerShell script - Stack Overflow

    If your script is named with the .ps1 extension and you're in a PowerShell window, you just run ./myscript.ps1 (assuming the file is in your working directory). This is true for me anyway on …

  2. How to run powershell script from .ps1 file? - Stack Overflow

    Oct 23, 2019 · Powershell.exe -executionpolicy remotesigned -File "C:\Path\script.ps1" If this still isn't working, please execute your batch file via CMD (copying the path, wrapped in quotation …

  3. Call PowerShell script PS1 from another PS1 script inside …

    I want call execution for a myScript1.ps1 script inside a second myScript2.ps1 script inside Powershell ISE. The following code inside MyScript2.ps1, works fine from Powershell …

  4. How to enable execution of PowerShell scripts? - Super User

    When I try to execute my PowerShell script I get this error: File C:\\Common\\Scripts\\hello.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get …

  5. Running a command as Administrator using PowerShell?

    Sep 12, 2016 · Here is how to run a elevated powershell command and collect its output form within a windows batch file in a single command (i.e not writing a ps1 powershell script).

  6. How to Execute Powershell Script AS Powershell 7 from Command …

    May 28, 2020 · In order for me to get this to work, I had to use the fully qualified address for Powershell, i.e.: "C:\Program Files\PowerShell\7\pwsh.exe". Only then was I actually running …

  7. How to run a PowerShell script with verbose output?

    Dec 26, 2016 · I'm wondering if there's a way to run a PowerShell script such that both the commands and the output of each line of the script are printed. For example, in Bash you …

  8. Run PowerShell script as a different user and elevated

    Jan 21, 2021 · Execute the Start-Process Powershell a little differently than you were executing it for it to take the action of the script logic while running elevated too. Add the ExecutionPolicy …

  9. Running PowerShell as another user, and launching a script

    Mar 11, 2015 · I won't get into all the details of why I need this, but users must be able to launch PowerShell as a service account and when PowerShell loads it needs to run a script. I already …

  10. how to use 'dry-run' in powershell - Stack Overflow

    Jun 26, 2012 · What if: Performing operation "Output to File" on Target "temp9.txt". Use on Nested functions in a different module Unfortunately, -WhatIf does not propagate automatically …