About 6,600,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. What does $script: do in PowerShell? - Stack Overflow

    Dec 2, 2010 · I bet you meant private. :-) so what happens when you dot-source a script with script: prefixes on functions and variables? Just keep in mind that dot-sourcing is a special …

  3. Windows Powershell policy execution bypass - Stack Overflow

    Apr 26, 2021 · In order to permanently change the execution policy, you need to run your powershell or registry change elevated, i.e Run as administrator. Additionally, you may have to …

  4. 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).

  5. 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 …

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

    Oct 23, 2019 · The simplest way is to right-click the file and choose 'Run with PowerShell'. As others have suggested, you can also run your .ps1 file using powershell.exe either in …

  7. How to handle command-line arguments in PowerShell

    What is the "best" way to handle command-line arguments? It seems like there are several answers on what the "best" way is and as a result I am stuck on how to handle something as …

  8. How to execute a PowerShell script using C# - Stack Overflow

    Apr 28, 2020 · Here's the full code that will run a PowerShell script when you create a console app in Visual Studio that will ByPass any restrictions. Just change the ps1File variable to your …

  9. How can I pass an argument to a PowerShell script?

    powershell.exe itunesForward.ps1 Is it possible to pass an argument from the command line and have it applied in the script instead of the hardcoded 30 seconds value?

  10. powershell - How can I find the source path of an executing script ...

    Jan 20, 2017 · A result of "script" means that the invocation correctly reported the location of the script. The "module" result means the invocation reported the location of the module …