Product: PowerShell Studio 2024 (64 Bit)
Build: v5.8.245
OS: Windows 10.0.19045
PS Version(s): 5.1.19041.1, 7.3.4, 7.3.4
If you use $Global: the value return null and does not load the selection in console or Regular
If you don't use $Global: it load the selection in console and Regular, but the variable does not get passed to other child forms
This is the error it throws Cordially,
Wøødy
Build: v5.8.245
OS: Windows 10.0.19045
PS Version(s): 5.1.19041.1, 7.3.4, 7.3.4
Code:
$buttonBrowse_Click = {
If ($LoadProfile.ShowDialog() -eq 'OK') {
$textboxFile.Text = $LoadProfile.FileName
If ([string]::IsNullOrEmpty($LoadProfile.FileName) -eq $false) {
$global:Selection = $LoadProfile.FileName
#$Selection = $LoadProfile.FileName
Import-Profile -Path $Selection
$labelLoadProfile.Text = "Profile [ $([system.IO.Path]::GetFileNameWithoutExtension($LoadProfile.FileName)) ]"
$formSelectKeyMapFile.Close()
}
}
}
If you don't use $Global: it load the selection in console and Regular, but the variable does not get passed to other child forms
This is the error it throws Cordially,
Wøødy
Statistics: Posted by Woody_033 — Fri Jun 28, 2024 12:22 pm