From 98020588cedadb7a4b61e23e38f8a3142d9b31d1 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 6 Aug 2024 12:21:48 +0200 Subject: [PATCH] Determine software script name properly --- scripts/Windows/Scripts/Software.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/Windows/Scripts/Software.ps1 b/scripts/Windows/Scripts/Software.ps1 index 30530345..f8000804 100644 --- a/scripts/Windows/Scripts/Software.ps1 +++ b/scripts/Windows/Scripts/Software.ps1 @@ -16,11 +16,11 @@ $null = New-Module { [hashtable] $Arguments ) + if (-not $Name) { + $Name = Split-Path -Leaf (Split-Path -Parent ((Get-PSCallStack)[1].ScriptName)); + } + Start-Operation { - if (-not $Name) { - $Name = Split-Path -Leaf (Split-Path -Parent ((Get-PSCallStack)[1].ScriptName)); - } - if ($null -ne $Name) { $Name = "``$Name``"; } else {