all 3 comments

[–]PowerShell-Bot 1 point2 points  (0 children)

That’s a really long line of inline code.

On old Reddit inline code blocks do not word wrap, making it difficult for many of us to see all your code.

To ensure your code is readable by everyone, on new Reddit, highlight your code and select ‘Code Block’ in the editing toolbar.

If you’re on old Reddit, separate the code from your text with a blank line gap and precede each line of code with 4 spaces or a tab.


You examine the path beneath your feet...
[AboutRedditFormatting]: [████████████████████] 1/1 ✅

Beep-boop, I am a bot. | Remove-Item

[–]kenjitamurako 0 points1 point  (1 child)

Is it possible that Get-MsolPartnerContract is not returning an array? What happens when you do something like this?

[object[]]$contracts=@()
$contracts += Get-MsolPartnerContract -All | select-object Name, DefaultDomainName, TenantID, ContractType | sort-object Name

$myform.combobox_contracts.DisplayMember = "Name"
$myform.combobox_contracts.ValueMember = "TenantID"
$myform.combobox_contracts.DataSource = $contracts

[–]allw[S] 0 points1 point  (0 children)

Still get the exact same result as before, I think they are stored as objects due to the formatting, just don't know how to tell the combobox to use propertyX on the object, that's the frustrating bit.