Customize NVS installation script

This commit is contained in:
Manuel Thalmann 2023-08-08 22:08:16 +02:00
parent edc431a2e1
commit f3d71b8e54
2 changed files with 21 additions and 7 deletions

View file

@ -157,13 +157,7 @@ function Restore-PersonalApps([Context] $context) {
python `
visualstudio2019-workload-vctools;
$env:NVS_HOME="$env:ProgramData\nvs";
git clone "https://github.com/jasongin/nvs.git" "$env:NVS_HOME";
& "$env:NVS_HOME\nvs.cmd" install;
refreshenv;
nvs add latest;
nvs link latest;
. "$PSScriptRoot/../Software/NVS/Install.ps1";
# Terminal
@($PROFILE, (powershell -c '$PROFILE')) | ForEach-Object {

View file

@ -0,0 +1,20 @@
#!/bin/pwsh
$env:NVS_HOME="$env:ProgramData\nvs";
git clone "https://github.com/jasongin/nvs.git" "$env:NVS_HOME";
& "$env:NVS_HOME\nvs.cmd" install;
$acl = Get-Acl "$env:NVS_HOME";
$acl.AddAccessRule(
[System.Security.AccessControl.FileSystemAccessRule]::new(
[System.Security.Principal.SecurityIdentifier]::new([System.Security.Principal.WellKnownSidType]::BuiltinUsersSid, $null),
[System.Security.AccessControl.RegistryRights]::FullControl,
[System.Security.AccessControl.InheritanceFlags]::ObjectInherit -bor [System.Security.AccessControl.InheritanceFlags]::ContainerInherit,
[System.Security.AccessControl.PropagationFlags]::InheritOnly,
[System.Security.AccessControl.AccessControlType]::Allow));
Set-Acl "$env:NVS_HOME" $acl;
refreshenv;
nvs add latest;
nvs link latest;