.PS1 - File Extension for PowerShell Scripts

Q

What is PS1? PS1, short name for PowerShell, is used as the file extension for PowerShell Scripts files. .PS1 files are text files that are used to store scripting codes written in Windows PowerShell language. See the sample .PS1 file included below.

✍: FYIcenter.com

A

File Extension: .PS1

MIME Type: text/plain

File Content: PowerShell Scripts

.PS1 files are PowerShell Scripts files, that are used to store scripting codes written in Windows PowerShell language. Here is a sample .PS1 PowerShell Scripts file, CL_WinSAT.ps1:

# Copyright ? 2008, Microsoft Corporation. All rights reserved.

. .\CL_Invocation.ps1
. .\CL_Utility.ps1

# Get videoMemoryBandwidth from registry
function GetVideoMemBandwidth()
{
[string]$path = "HKLM:\SOFTWARE\Microsoft\Windows Nt\CurrentVersion\WinSat"
    [string]$name = "VideoMemoryBandwidth"
    [int]$VideoMemoryBandWidth = 0
    if(Test-Path $path)
    {
        $registryEntry = Get-ItemProperty -Path $path -Name $name
        if($registryEntry -ne $null)
        {
            $VideoMemoryBandWidth = $registryEntry.$name
        }
    }

    return ($videoMemoryBandWidth / 1KB)
}

.PS1 PowerShell Scripts file sample: Click sample.ps1 to download.

Since .PS1 files are in text format, you can use Notepad or any text editor to create or modify them. No special software is needed.

For for information on how to use .PS1 PowerShell Scripts files, see links below:

2012-10-21, 3691👍, 0💬