Skip to content

Edit-Script

SYNOPSIS

Open the definition of a PowerShell script in Notepad.

SYNTAX

Edit-Script [[-Script] <Object>]

DESCRIPTION

This function opens the definition of a specified PowerShell script in Notepad for editing. It resolves the script's path using the `Get-Command` cmdlet and passes it to Notepad.

EXAMPLES

EXAMPLE 1

Edit-Script -Script "Get-Process"

Opens the definition of the "Get-Process" script in Notepad.

EXAMPLE 2

Edit "Get-Service"

Opens the definition of the "Get-Service" script in Notepad using the alias `Edit`.

PARAMETERS

-Script

The name of the PowerShell script to open in Notepad.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

INPUTS

OUTPUTS

NOTES