Ensure error file can be read from

This commit is contained in:
Manuel Thalmann 2024-08-19 02:24:45 +02:00
parent 65ada0273e
commit c859646800
2 changed files with 8 additions and 1 deletions

View file

@ -135,6 +135,7 @@ $null = New-Module {
} }
catch { catch {
Set-Content -Path $errorPath -Value $Error; Set-Content -Path $errorPath -Value $Error;
Set-UserPermissions $errorPath;
} }
finally { finally {
Set-Stage ([SetupStage]::Idle); Set-Stage ([SetupStage]::Idle);

View file

@ -55,7 +55,13 @@ $null = New-Module {
[FileSystemAccessRule]::new( [FileSystemAccessRule]::new(
[SecurityIdentifier]::new([WellKnownSidType]::BuiltinUsersSid, $null), [SecurityIdentifier]::new([WellKnownSidType]::BuiltinUsersSid, $null),
[FileSystemRights]::FullControl, [FileSystemRights]::FullControl,
[InheritanceFlags]::ObjectInherit -bor [InheritanceFlags]::ContainerInherit, (& {
if (Test-Path -PathType Container $Path) {
[InheritanceFlags]::ObjectInherit -bor [InheritanceFlags]::ContainerInherit
} else {
0
}
}),
[PropagationFlags]::InheritOnly, [PropagationFlags]::InheritOnly,
[AccessControlType]::Allow)); [AccessControlType]::Allow));