PS1Exec icon

PS1Exec

3.0/5 2
Certified 100% CLEAN Freeware   

Easily execute a PowerShell script. #PowerShell Script  #Execute Script  #Run Script  #PowerShell  #Execute  #Console  

Description

Free Download

The PS1Exec application was designed to be a small tool that lets you easily execute a PowerShell script without having to worry about getting the quoting correct on the powershell.exe command line.

Windows PowerShell's installation philosophy is "secure by default." One of the implications of this philosophy is that after you initially install PowerShell, you can only use it as an interactive command interpreter—it won't run scripts unless you change the default execution policy. However, most of us end up changing the default execution policy so that we can run scripts—after all, scripts are one of PowerShell's most powerful features.

However, even after you enable script execution, you still can't directly schedule a PowerShell script (.ps1) in the task scheduler. This is indeed more secure, but as we all know, usability is typically inversely proportional to security. Of course, it is possible to schedule a PowerShell script if you get the powershell.exe command line just right, but this can be tricky if the script's path contains spaces or if the script requires command-line arguments that contain spaces.

Also, I discovered I wanted a little bit more control over the PowerShell console window. For example, I wanted to be able to specify that a script should run hidden or minimized, or with a different console window title. To solve these problems, I wrote ps1exe32 (32-bit) and ps1exe64 (64-bit). (In this documentation, I refer to both versions, ps1exe32 and ps1exe64, as ps1exec.) ps1exe32 is for 32-bit Windows, and ps1exe64 is for 64-bit Windows.

ps1exec makes it possible to easily execute a PowerShell script (.ps1) file, and it also gives the administrator some control over the PowerShell console window's initial window state and title. Here are some reasons ps1exec might be a useful tool in your environment: - ps1exec finds powershell.exe by reading the registry, so you don't need to worry about the case where the PowerShell installation directory is missing from the system path. (This should be rare, but I have seen a broken path setting on more machines that I care to remember.) - ps1exec simplifies scheduling PowerShell scripts because you don't have to worry about making a quoting mistake when constructing the powershell.exe command line. - ps1exec runs a PowerShell script in a separate console window, so you can use ps1exec to start a long-running script in a separate window without stopping your work in an existing window. - ps1exec can pause a script's console window after running the script, in case you want to view the script's output. - ps1exec allows you to specify the PowerShell console window's initial state (e.g., hidden, minimized, etc.) as well as the console window's title.

ps1exec's command-line syntax is as follows:

ps1exe32 [-p] [-q] [-w] [-d path] [-s windowstate] [-t title] scriptfile [argument [...]]

On 64-bit platforms, use ps1exe64 instead of ps1exe32. (If you run ps1exe32 on a 64-bit machine, it will execute the 32-bit version of PowerShell instead of the 64-bit version, which is probably not what you intended.)

Important! All of ps1exec's command-line arguments (-p, -q, -w, -d, -s, and -t) must appear before the script file's name on the command line.

ps1exec's command-line arguments are as follows:

-p Causes the console window to pause for an Enter keystroke after the script finishes running.

-q ps1exec runs silently. Without -q, ps1exec will display a dialog box if it encounters an error.

-w Wait for powershell.exe to close. Without -w, ps1exec will start powershell.exe to run the script and then exit immediately. (I recommend -w if you use ps1exec to schedule a PowerShell script so that the task scheduler will know when the script finishes running.)

-d path Specify a starting directory for powershell.exe. If the path contains spaces, enclose it in double quotes ("). You can also use single quotes around the path (') if you are running ps1exec from a PowerShell prompt.

-s windowstate windowstate is a number that specifies the default initial window state for the PowerShell console window. The default window state is 1.

-t title Specify a title for the PowerShell console window. If the title contains spaces, enclose it in double quotes ("). You can also use single quotes around the title (') if you are running ps1exec from a PowerShell prompt.

scriptfile Specify the filename of the PowerShell script (.ps1) file you want to run. If the script's path and/or filename contains spaces, enclose the entire path and filename in double quotes ("). You can also use single quotes around the script file's name and path (') if you are running ps1exec from a PowerShell prompt.

argument If the script requires one or more command-line arguments, specify them after the script file's name. If a script's argument contains spaces, enclose it in double quotes ("). It is not currently possible to embed a double quote character (") in a script argument. You can use single quotes (') instead of double quotes, but you must double embedded single quotes.

PS1Exec 1.0

add to watchlist add to download basket send us an update REPORT
  runs on:
Windows All
  file size:
47 KB
  filename:
ps1exec_1.zip
  1 screenshot:
PS1Exec - screenshot #1
  main category:
Programming
  developer:
  visit homepage

Windows Sandbox Launcher

Set up the Windows Sandbox parameters to your specific requirements, with this dedicated launcher that features advanced parametrization
Windows Sandbox Launcher

Zoom Client

The official desktop client for Zoom, the popular video conferencing and collaboration tool used by millions of people worldwide
Zoom Client

IrfanView

With support for a long list of plugins, this minimalistic utility helps you view images, as well as edit and convert them using a built-in batch mode
IrfanView

4k Video Downloader

Export your favorite YouTube videos and playlists with this intuitive, lightweight program, built to facilitate downloading clips from the popular website
4k Video Downloader

ShareX

Capture your screen, create GIFs, and record videos through this versatile solution that includes various other amenities: an OCR scanner, image uploader, URL shortener, and much more
ShareX

Context Menu Manager

Customize Windows’ original right-click context menu using this free, portable and open-source utility meant to enhance your workflow
Context Menu Manager

Microsoft Teams

Effortlessly chat, collaborate on projects, and transfer files within a business-like environment by employing this Microsoft-vetted application
Microsoft Teams

Bitdefender Antivirus Free

Feather-light and free antivirus solution from renowned developer that keeps the PC protected at all times from malware without requiring user configuration
Bitdefender Antivirus Free

7-Zip

An intuitive application with a very good compression ratio that can help you not only create and extract archives, but also test them for errors
7-Zip

calibre

Effortlessly keep your e-book library thoroughly organized with the help of the numerous features offered by this efficient and capable manager
calibre

38% discount
Bitdefender Antivirus Free
  • Bitdefender Antivirus Free
  • 7-Zip
  • calibre
  • Windows Sandbox Launcher
  • Zoom Client
  • IrfanView
  • 4k Video Downloader
  • ShareX
  • Context Menu Manager
  • Microsoft Teams
essentials


Click to load comments
This enables Disqus, Inc. to process some of your data. Disqus privacy policy