PowerShell Universal - 4.0.8

PowerShell Universal - 4.0.8

Release Notes

Automation

  • Fixed an issue where rerun job would not populate string array parameters correctly. (#2434)
  • Fixed an issue where rerun job would not select the correct parameter set

Apps

  • Fixed an issue where New-UDTickPicker didn’t display the picker component (#2551)
  • Fixed an issue where New-UDToolTip didn’t have a -Type parameter
  • Fixed an issue where New-UDAutoComplete would display the value rather than the name of New-UDAutoComplete option when using -OnLoadOptions
  • Fixed an issue where the export and delete logging buttons would not work for nested IIS sites (#2554)
  • Fixed an issue where -Scrollable on didn’t work on New-UDTabs (#2557)
  • Fixed an issue where -Size for New-UDButton didn’t display properly on the live docs (#2462)
  • Fixed an issue where Get-UDElement would return an invalid value from New-UDAutoComplete
  • Fixing issues with Show-UDToast -MessageSize (#1000)
  • Fixing issues with Show-UDToast -Icon (#1913)
  • Fixed a JavaScript error in the App Designer
  • Fixed an issue where boolean parameters would not be serialized properly by the app designer (#2562)
  • Fixed an issue where templates wouldn’t work on Linux due to case sensitivity
  • Fixed visual issues with textbox and autocomplete (#2419)

Platform

  • Published folders now set the Cache-Control and Last-Modified headers
  • Fixed an issue with creating and edit roles in the admin console (#2563)
  • Fixed a concurrency issue with $Cache scope (#2564)

Downloads

1 Like

After updating my autocompletes no longer work

New-UDAutocomplete -OnLoadOptions {
                Get-ADcomputer -Filter "samaccountname -like '*$body*'" -SearchBase "ou=OU,dc=DOMAIN,dc=LOCAL" -SearchScope Subtree | Select-Object -ExpandProperty name | ConvertTo-Json
            } -OnChange {
                $session:device = $Body 
            }

Nothing will load in the boxes anymore.

Wow, this is actually really useful. Following so I can take this when its fixed.

Testing out the Autocomplete issue. It looks like the OnLoadOptions is working. I can export the Get-ADComputer output to a text file and it shows the correct data, but it doesn’t show the actual dropdown in the UI to make a selection so it never does the OnChange.

We are looking into this one.

Cool. I swapped out the automcomplete for a basic textbox for the time being. My users are fine with that.

Hoping I might be able to shed some more light on this issue, as it is happening to me as well, and kind of has been for a while.

What’s been happening for a while seems to be that when the AutoComplete field is left with the value it was loaded with and Get-UDElement is called to pull data from it .value is what is says in the AutoComplete box, regardless of the fact that it has been loaded with AutoCompleteOptions that give it a name and value. This was easy enough to work around with a check to see if the value returned was what I was expecting and if not pull the value out of somewhere else using what is supplied to me.

At the same time, though, if the field was changed then the value from the selected AutoCompleteOption would be there but only if pulled from .value.value, now it seems that .value.value is no longer there at all and only .value is which will contain either text (ignoring the value in the AutoCompleteOption value) or it is the value of the AutoCompleteOption value when a change was made.

This is much less easy to work around (time consuming to change all the logic I have already built) and tbh I would much rather it respect the AutoCompleteOption value if it is loaded with them. Either with .value.value like before or just .value as I can work with that a lot easier.

I will not argue if I am using it wrong and I welcome a better way to use it but I believe that this is not intended to function the way that it is.

I’ve been super distracted with other things while typing this… so ask for clarification if it doesn’t make sense and I will try to clear it up later when/if I have time.

After thinking about this more I think I know (to a degree) the underlying issue with a possible solution, issue being that the default -Value is just text input which get processed as if you simply provided an array of strings. Basically I think this can be solvable if the starting -Value were able to accept a AutocompletOption object as an input as well.

$PreviousComputerData #Data to prefill fields from somewhere else, ex. @{Name = ComputerName1; ObjectGUID = GUID1}
$ADComputers = Get-ADComputer -Filter * -Properties @(“ObjectGUID”, “Name”) #Example
$ComputerList = [System.Collections.Generic.List[Object]]::new()

foreach ($Comp in $ADComputers) {
$ComputerList.Add((New-UDAutocompleteOption -Name “$($Comp.Name)” -Value “$($Comp.ObjectGUID)”))
}

New-UDAutocomplete -Id ‘lstADComps’ -Label “Select a Computer” -Value “$($PreviousComputerData.Name)” -Options $ComputerList.ToArray()

New-UDButton -Text “Do Thing” -OnClick {
Show-UDToast -Message “$((ConvertTo-Json -InputObject (Get-UDElement -Id ‘lstADComps’)))” -Duration 15000
}

#Output with defaults value
{
“onChange”: null,
“id”: “lstADComps”,
“variant”: “standard”,
“assetId”: null,
“onEnter”: null,
“type”: “mu-autocomplete”,
“label”: “Select a Computer”,
“className”: “”,
“value”: “ComputerName1”, #<- This here should always be the value in the value section of the object and not the displayed value (or text, however you define it)
“isPlugin”: true,
“options”: [
{
“name”: “ComputerName1”,
“value”: “GUID1”,
“type”: “mu-autocomplete-option”
},
{
“name”: “ComputerName2”,
“value”: “GUID2”,
“type”: “mu-autocomplete-option”
}
],
“onLoadOptions”: null,
“icon”: null,
“fullWidth”: false,
“multiple”: false
}

#Output after changing the selection (even if you select the same thing)
{
“onChange”: null,
“id”: “lstADComps”,
“variant”: “standard”,
“assetId”: null,
“onEnter”: null,
“type”: “mu-autocomplete”,
“label”: “Select a Computer”,
“className”: “”,
“value”: “GUID1”, #<- This here should always be the value in the value section of the object and not the displayed value (or text, however you define it)
“isPlugin”: true,
“options”: [
{
“name”: “ComputerName1”,
“value”: “GUID1”,
“type”: “mu-autocomplete-option”
},
{
“name”: “ComputerName2”,
“value”: “GUID2”,
“type”: “mu-autocomplete-option”
}
],
“onLoadOptions”: null,
“icon”: null,
“fullWidth”: false,
“multiple”: false
}

I hope this makes more sense than my earlier, sleep deprived, ramblings

Went ahead and did another attempt at migrating over to V4.

This time, I’m stuck at trying to add a new App Token through the UI.
At the same time, the Access Controls page suffers from the same issue where the modal to add either a new App Token or create a new Access Control keeps refreshing itself, making it impossible to define any settings.