-
Notifications
You must be signed in to change notification settings - Fork 8
Open Code
A drop-in replacement for the Visual Studio Code CLI `code`. Allows tab-completion of GitPath aliases if ProjectPaths are filled out with PSProfile that expand to the full path when invoked.
Open-Code [-Path] <String> [-AddToWorkspace] [-WithInsiders] [-ArgumentList <String[]>] [<CommonParameters>]
Open-Code [[-Path] <String>] [-InputObject <Object>] [-Language <String>] [-Wait] [-WithInsiders]
[-ArgumentList <String[]>] [<CommonParameters>]
Open-Code [-AddToWorkspace] [-WithInsiders] [-ArgumentList <String[]>] [<CommonParameters>]
A drop-in replacement for the Visual Studio Code CLI `code`. Allows tab-completion of GitPath aliases if ProjectPaths are filled out with PSProfile that expand to the full path when invoked.
Get-Process | ConvertTo-Csv | Open-Code -Language csv
Gets the current running processes, converts to CSV format and opens it in Code via background job as a CSV. Easy Out-GridView!
def Update-PSProfileSetting | code -l ps1
Using shorter aliases, gets the current function definition of the Update-PSProfileSetting function and opens it in Code as a PowerShell file to take advantage of immediate syntax highlighting.
The path of the file or folder to open with Code. Allows tab-completion of GitPath aliases if ProjectPaths are filled out with PSProfile that expand to the full path when invoked.
Type: String
Parameter Sets: Path
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: InputObject
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
If $true, adds the folder to the current Code workspace.
Type: SwitchParameter
Parameter Sets: Path, Cookbook
Aliases: add, a
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Pipeline input to display as a temporary file in Code. Temp files are automatically cleaned up after the file is closed in Code. No need to add the `-` after `code` to specify that pipeline input is expected.
Type: Object
Parameter Sets: InputObject
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
The language or extension of the temporary file created from the pipeline input. This allows specifying a file type like 'powershell' or 'csv' or an extension like 'ps1', enabling opening of the temp file with the editor file language already set correctly.
Type: String
Parameter Sets: InputObject
Aliases: l, lang, Extension
Required: False
Position: Named
Default value: Txt
Accept pipeline input: False
Accept wildcard characters: False
If $true, waits for the file to be closed in Code before returning to the prompt. If $false, opens the file using a background job to allow immediately returning to the prompt. Defaults to $false.
Type: SwitchParameter
Parameter Sets: InputObject
Aliases: w
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
If $true, looks for VS Code Insiders to load. If $true and code-insiders cannot be found, opens the file using VS Code stable. If $false, opens the file using VS Code stable. Defaults to $false.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: insiders, wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Any additional arguments to be passed directly to the Code CLI command, e.g. `Open-Code --list-extensions` or `code --list-extensions` will still work the same as expected.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
- Command Aliases
- Configuration
- Helpers
- Init Scripts
- Meta
- Modules to Import
- Modules to Install
- Path Aliases
- Plugin Paths
- Plugins
- Power Tools
- Project Paths
- Prompts
- Script Paths
- Secrets
- Symbolic Links
- Variables
- Export-PSProfileConfiguration
- Import-PSProfile
- Import-PSProfileConfiguration
- Save-PSProfile
- Start-PSProfileConfigurationHelper
- Update-PSProfileConfig
- Update-PSProfileRefreshFrequency
- Update-PSProfileSetting
- Add-PSProfileToProfile
- Copy-Parameters
- Get-LastCommandDuration
- Get-PathAlias
- Get-PSProfileArguments
- Get-PSVersion
- Test-IfGit
- Write-PSProfileLog
- Add-PSProfileInitScript
- Disable-PSProfileInitScript
- Edit-PSProfileInitScript
- Enable-PSProfileInitScript
- Get-PSProfileInitScript
- Remove-PSProfileInitScript
- Confirm-ScriptIsValid
- Enter-CleanEnvironment
- Format-Syntax
- Get-Definition
- Get-Gist
- Get-LongPath
- Install-LatestModule
- Open-Code
- Open-Item
- Pop-Path
- Push-Path
- Start-BuildScript
- Test-RegEx
- Add-PSProfilePrompt
- Edit-PSProfilePrompt
- Get-PSProfilePrompt
- Remove-PSProfilePrompt
- Switch-PSProfilePrompt