Hi,
I’ve created an XML Dialog Window with a button and added the add_click Event to the script:
`
$WPFbuttonPreviewGroup.add_Click({
#Write-Host “Previewing group”
$param1 = “`$_.” + $WPFComboField1.SelectedValue + " " + $WPFComboBool1.SelectedValue + " " + ‘"’ + $WPFtextValue1.Text + ‘"’
$MsolUserList = Import-Csv “allMsolUser.csv” -Delimiter “;”
$MsolUserList | ft
$commandstring = ‘$msolUserList | ?{’ + $param1 + ‘}’
$x = Invoke-Expression $commandstring -Verbose
})`
When I run the script above manually from ISE, it work fine.
But when I call the dialog box and pressing the button to fire the event, the script doesn’t import the csv file.
All other command within this script work fine (e.g. $param1 = …)