Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit d970e63

Browse files
profile.ps1: Differentiate between an elevated and non-elevated processes
1 parent 36416b1 commit d970e63

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/profile.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,12 @@ function Start-Process {
202202

203203
# Log process start success
204204
if ($process) {
205-
Write-Message "Process started successfully: $FilePath (PID: $($process.Id))"
205+
if ($processStartInfo.UseShellExecute -and ($processStartInfo.Verb -eq 'runas')) {
206+
Write-Message "Elevated process started successfully: $FilePath (PID: $($process.Id))"
207+
}
208+
else {
209+
Write-Message "Non-elevated process started successfully: $FilePath (PID: $($process.Id))"
210+
}
206211
}
207212

208213
# If PassThru is specified, return the process object

0 commit comments

Comments
 (0)