$Script:Variable work in debug mode but not in build

Use this forum to ask about non-product related topics (login issues, product registrations, web site questions, etc.) No technical support questions, please.
Forum rules
Do not post any licensing information in this forum.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Frigoult
Posts: 1
Last visit: Mon Oct 28, 2024 5:22 am

$Script:Variable work in debug mode but not in build

Post by Frigoult »

Hi Community,

I declared a variable :

Code: Select all

[Boolean]$sortDescending = $False
When I modify it in a function, it works in debug mode. It no longer works in the compiled exe.

Code: Select all

 $LV_WSFilesHeaderName.add_Click({
        if ($sortDescending) {
            $FolderWS.ListFiles = $FolderWS.ListFiles | Sort-Object -Property FullName -Descending
            $Script:sortDescending = $False
        }
        else {
            $FolderWS.ListFiles = $FolderWS.ListFiles | Sort-Object -Property FullName
            $Script:sortDescending = $True
        }
        $XMLForm.DataContext[1] = $FolderWS
    })
Thank you for your attention
User avatar
Alexander Riedel
Posts: 8583
Last visit: Fri Nov 08, 2024 3:54 pm
Answers: 23
Been upvoted: 42 times

Re: $Script:Variable work in debug mode but not in build

Post by Alexander Riedel »

You account has no eligible license for support. Please contact support@sapien.com with your license details.
Alexander Riedel
SAPIEN Technologies, Inc.