-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test allowed extensions policy #235002
Comments
@Gijsreyn good feedback, but the value of the group policy setting needs to be JSON serializable object! @ntrogh let's make sure we document that (if we have not already).
Testers here's an example JSON object you can put as the value
|
Also please note that there is a bug in today's insiders that reading policies from the registry is not working. End-end should be working from tomorrow's build. |
Instructions are included in our vnext docs, to be released with 1.96 : https://github.com/microsoft/vscode-docs/blob/5f8d57339f7334ab2e63ad162d538815419c3a9d/docs/setup/enterprise.md?plain=1#L79
|
Hi @sandy081 and @isidorn. I know this item is closed, but hopefully I can still leave some feedback here. If you want me to raise another issue, I can. Perhaps it is good to document the current limitations e.g.:
A script might also be useful to set the relevant registry key. # Change HKLM: to HKCU: if you want to do it for the user
$registryPath = 'HKLM:\SOFTWARE\Policies\Microsoft\VSCodeInsiders'
$propertyName = 'AllowedExtensions'
$propertyValue = @{'ms-vscode.powershell' = $true }
# Check if the registry key exists
if (-not (Test-Path $registryPath)) {
# Create the registry key
New-Item -Path $registryPath -Force
}
# Check if the property exists
if (-not (Get-ItemProperty -Path $registryPath -Name $propertyName -ErrorAction SilentlyContinue)) {
# Create the property
New-ItemProperty -Path $registryPath -Name $propertyName -Value ($propertyValue | ConvertTo-Json -Compress) -PropertyType String -Force
} else {
Write-Output "The property '$propertyName' already exists."
} P.S. While I recognize you want to document it in a timely manner with the release, I'm happy to contribute to the docs. I'll be putting up a blog post on it later this morning, so I have some content laying around. Just let me know :) |
@Gijsreyn What exactly do you mean by not being able to pin a specific version? You can specify an extension and version to allow only that one ( I'll add a note about not supporting wildcards. BTW, you can use |
@ntrogh You are not misinterpreting it. I should have been testing with an actual version that exist, which I didn't. Apologize, and thanks for providing the example. Will wait for the awesome documentation to come. Cheers! |
Thanks for challenging us. Makes the docs better! |
Hi, just want to share that I tried this policy and found that although the extensions set in the group policy are being locked down (i.e. you cannot override the settings set by your administrator), any additional extensions you set in your settings.json will be allowed to install. |
Refs: #84756
Complexity: 3
Create Issue
Feature Documentation
Test that Allowed Extensions (
extensions.allowed
) setting can be added as a group policy on Windows.Set up policies
policies
folder.policies\VSCodeInsiders.admx
file toC:\Windows\PolicyDefinitions\
policies\en-us\VSCodeInsiders.adml
file toC:\Windows\PolicyDefinitions\en-us
Win R
, typegpedit.msc
hit Enter{User,Computer} Configuration/Administrative Templates/Visual Studio Code - Insiders/Extensions
. To set it:{"microsoft": true}
Testing
extensions.allowed
setting in the settings editor and make sureThe text was updated successfully, but these errors were encountered: