external help file | Module Name | ms.date | online version | schema | title |
---|---|---|---|---|---|
Microsoft.VSCode.Dsc.psm1-Help.xml |
Microsoft.VSCode.Dsc |
10/22/2024 |
2.0.0 |
VSCodeExtension |
Manages Visual Studio Code extensions using DSC.
The VSCodeExtension
DSC Resource allows you to install, update, and remove Visual Studio Code extensions. This resource ensures that the specified Visual Studio Code extension is in the desired state.
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Name |
Key | String | The name of the Visual Studio Code extension to manage. | To find extensions in VSCode, check out: https://code.visualstudio.com/docs/editor/extension-marketplace#_find-and-install-an-extension |
Version |
Optional | String | The version of the Visual Studio Code extension to install. If not specified, the latest version will be installed. | For example: 1.0.0 |
Exist |
Optional | Boolean | Indicates whether the extension should exist. The default value is $true . |
$true , $false |
Insiders |
Optional | Boolean | Indicates whether to manage the extension for the Insiders version of Visual Studio Code. The default value is $false . |
$true , $false |
# Install the latest version of the Visual Studio Code extension 'ms-python.python'
$params = @{
Name = 'ms-python.python'
}
Invoke-DscResource -Name VSCodeExtension -Method Set -Property $params -ModuleName Microsoft.VSCode.Dsc
# Install a specific version of the Visual Studio Code extension 'ms-python.python'
$params = @{
Name = 'ms-python.python'
Version = '2021.5.842923320'
}
Invoke-DscResource -Name VSCodeExtension -Method Set -Property $params -ModuleName Microsoft.VSCode.Dsc
# Ensure the Visual Studio Code extension 'ms-python.python' is removed
$params = @{
Name = 'ms-python.python'
Exist = $false
}
Invoke-DscResource -Name VSCodeExtension -Method Set -Property $params -ModuleName Microsoft.VSCode.Dsc
# Ensure the Visual Studio Code extension 'ms-python.python' is removed
$params = @{
Name = 'ms-python.python'
Insiders = $true
}
Invoke-DscResource -Name VSCodeExtension -Method Set -Property $params -ModuleName Microsoft.VSCode.Dsc