About 325,000 results
Open links in new tab
  1. How to run powershell script from .ps1 file? - Stack Overflow

    Oct 23, 2019 · Create a batch file which points at your .ps1 file. You may be required to run the batch file with elevated permissions, depending on your access levels (the logged in account …

  2. What is the purpose of the *.psm1 files in a Powershell module?

    Apr 27, 2019 · Although PowerShell allows importing .ps1 files as modules, them does not create modules the same way as .psm1 files does. Them does not have their own session state and …

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

    I have a batch script which runs a ps1 file but with a profile. That profile.ps1 outputs text when it loads. In some scripts, I want to disable the output of that text if I don't need it. For that, I …

  4. What are the different PowerShell file types? - Stack Overflow

    Jun 27, 2020 · .ps1 files are PowerShell scripts; it is the most common type of PowerShell file and one that is the most like other shell scripts like .sh, .bat files .psm1 files are PowerShell …

  5. Is there a way to make a PowerShell script work by double clicking …

    11 You may set the default file association of ps1 files to be powershell.exe which will allow you to execute a powershell script by double clicking on it. In Windows 10, Right click on a ps1 file …

  6. How to output something in PowerShell - Stack Overflow

    Jan 11, 2010 · then, if you call the script with redirected output, something like yourscript.ps1 > out.txt, you will get test2 on the screen test1\ntest3\n in the "out.txt". Note that "test3" and the …

  7. How to pass command-line arguments to a PowerShell ps1 file

    Aug 18, 2009 · To add to EBGreen's comment, the basic security problem that PowerShell's tries to avoid is folks double-clicking on PS1 files attached to email and having the script run. That's …

  8. How to fix "running scripts is disabled on this system"?

    Nov 1, 2020 · This is because of Execution Policy. This defines how powershell scripts will run. In Default windows desktops, it is Restricted, not allowing any scripts (signed or unsigned) only …

  9. How do you comment out code in PowerShell? - Stack Overflow

    Sep 8, 2011 · Note '#' is a comment in many shell and script languages: bash, python, php, ruby, and now powershell.

  10. dot source - In PowerShell, how do I define a function in a file and ...

    May 16, 2011 · I have a .ps1 file in which I want to define custom functions. Imagine the file is called MyFunctions.ps1, and the content is as follows: Write-Host "Installing functions" function …