What is the PS1 file format?
A .ps1 file is a plain-text script written in the PowerShell scripting language, developed by Microsoft. PowerShell launched in November 2006 with Windows PowerShell 1.0 as a modern replacement for older .bat and .cmd batch scripts, built on an object-oriented shell running on the .NET runtime.
Scripts contain sequences of cmdlets, functions, variables, and control-flow statements. An optional #Requires header at the top specifies a minimum PowerShell version or required modules, and a param() block declares script parameters. On Windows, execution is blocked by default - the ExecutionPolicy is set to Restricted, so a script will not run until the policy is relaxed with Set-ExecutionPolicy or the file is launched via right-click → Run with PowerShell.
Two active branches exist side by side:
- Windows PowerShell 5.1 - built into Windows 10 and 11; defaults to UTF-16 LE encoding; no longer actively developed.
- PowerShell 7 (formerly PowerShell Core) - cross-platform on Windows, macOS, and Linux; defaults to UTF-8 without BOM; actively maintained.
Both branches read .ps1 files identically. Authenticode code signing (via Set-AuthenticodeSignature) appends a # SIG # Begin signature block trailer to the file; editing the file afterwards invalidates the signature.
Security & safety
RISK: HIGHPS1 is the #1 Windows scripting malware vector. PowerShell can download payloads, bypass UAC, disable antivirus, encrypt files (ransomware), and exfiltrate data. Default Windows ExecutionPolicy (Restricted) blocks execution, but attackers routinely bypass it with -ExecutionPolicy Bypass or by encoding scripts in Base64 (-EncodedCommand). Red flags: scripts that run Invoke-WebRequest/IEX (Invoke- Expression), disable antivirus, or arrive as email attachments. Safe practice: always read the script in a text editor before running; use PowerShell Script Block Logging (EventID 4104) on corporate systems. Signed scripts (Set- AuthenticodeSignature with a trusted cert) are safer but not immune.
Format details
in a nutshell- Adobe PostScript Level 1 file (.ps) - Rare: some systems associate .ps1 with PostScript level 1 files, distinct from PowerShell scripts.
Programs that open PS1 files
Technical details
deep spec| Encoding | UTF-16 LE (Windows PowerShell 5.1 / ISE default) or UTF-8 without BOM (PowerShell 7 default) |
| Byte order mark | UTF-16 LE BOM (FF FE) common from ISE; PowerShell 7 omits BOM by default |
| Container | Plain text; no binary wrapper |
| MIME type | application/x-powershell (also text/x-powershell and text/plain) |
| Script structure | Cmdlets, functions, variables, control-flow; optional #Requires and param() blocks |
| Execution policy | Blocked by default on Windows (Restricted); requires Set-ExecutionPolicy or right-click Run with PowerShell |
| Code signing | Authenticode via Set-AuthenticodeSignature; # SIG # Begin signature block appended as plain-text trailer; editing the file invalidates the signature |
| Runtime | .NET Framework (Windows PowerShell 5.1); .NET 5+ (PowerShell 7) |
| Cross-platform support | Windows, macOS, Linux - PowerShell 7 only; Windows PowerShell 5.1 is Windows-only |
| Module integration | Scripts can dot-source .psm1 module files and reference .psd1 module manifests |
| Version directive | #Requires -Version X.Y enforces minimum PowerShell version; #Requires -Modules enforces module availability |
| Typical size | 1 KB - 1 MB; most scripts under 100 KB |
| Related script formats | .psm1 (module), .psd1 (manifest), .ps1xml (type and format data) |
| Released | November 14, 2006 (Windows PowerShell 1.0) |
| Latest version | PowerShell 7.5 (2025); format itself is plain text with no version field |
| Open standard | Yes · royalty-free |
| Specification | learn.microsoft.com |
PS1 conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about PS1 files.