You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/PSAppDeployToolkit/Public/Invoke-ADTRegSvr32.ps1
+6-17Lines changed: 6 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ function Invoke-ADTRegSvr32
19
19
.PARAMETERAction
20
20
Specify whether to register or unregister the DLL.
21
21
22
-
.PARAMETERPerUser
22
+
.PARAMETERAsUser
23
23
Specifies that the DLL should be registered for the current user only by calling its DllInstall entry point with the 'user' argument (regsvr32.exe /n /i:user). If this function is running under the SYSTEM account, regsvr32.exe is executed in the context of the currently logged on user. Note that the DLL must support per-user registration via a DllInstall export for this to work.
# Register the DLL file and measure the success. Per-user registration writes to the
168
168
# user's HKCU hive, so when running as SYSTEM, execute as the logged on user instead.
169
-
if ($PerUser-and [PSADT.AccountManagement.AccountUtilities]::CallerSid.IsWellKnown([System.Security.Principal.WellKnownSidType]::LocalSystemSid))
169
+
if ($AsUser)
170
170
{
171
-
if (!(Get-ADTClientServerUser))
172
-
{
173
-
$naerParams=@{
174
-
Exception= [System.InvalidOperationException]::new("The DLL file [$FilePath] cannot be $($Action.ToLowerInvariant() +'ed') per-user as there is no logged on user to process the request against.")
Copy file name to clipboardExpand all lines: src/PSAppDeployToolkit/Public/Register-ADTDll.ps1
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ function Register-ADTDll
16
16
.PARAMETERFilePath
17
17
Path to the DLL file.
18
18
19
-
.PARAMETERPerUser
19
+
.PARAMETERAsUser
20
20
Specifies that the DLL should be registered for the current user only by calling its DllInstall entry point with the 'user' argument (regsvr32.exe /n /i:user). If this function is running under the SYSTEM account, regsvr32.exe is executed in the context of the currently logged on user. Note that the DLL must support per-user registration via a DllInstall export for this to work.
Copy file name to clipboardExpand all lines: src/PSAppDeployToolkit/Public/Unregister-ADTDll.ps1
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ function Unregister-ADTDll
16
16
.PARAMETERFilePath
17
17
Path to the DLL file.
18
18
19
-
.PARAMETERPerUser
19
+
.PARAMETERAsUser
20
20
Specifies that the DLL should be unregistered for the current user only by calling its DllInstall entry point with the 'user' argument (regsvr32.exe /u /n /i:user). If this function is running under the SYSTEM account, regsvr32.exe is executed in the context of the currently logged on user. Note that the DLL must support per-user registration via a DllInstall export for this to work.
0 commit comments