sokoban
September 4, 2024, 9:25am
1
Hi
Very simple question …
How will I type when I want view only PowerApps in my list in MSCommerce policy ?
I have typing :
Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase `
| -Select-Object -Property ProductName “Power ”
// Sokoban
Olaf
September 4, 2024, 11:04am
2
When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thanks in advance
How to format code in PowerShell.org 1 <---- Click
( !! Sometimes the preformatted text button hides behind the settings gear symbol. )
Instead of the misstyped Select-Object
…
… you should use a Where-Object
to filter for the objects or properties you’re after.
sokoban
September 5, 2024, 9:43am
3
There is no command with the name -Where-Object …
Olaf
September 5, 2024, 10:03am
4
Of course not. The names of PowerShell cmdlets have the format “Verb-Noun” … no dash in front of the verb!!
So the name of the command is Where-Object
… here you can read more about:
The Where-Object cmdlet selects objects that have particular property values from the collection of objects that are passed to it. For example, you can use the Where-Object cmdlet to select files that were created after a certain date, events with a...
1 Like
sokoban
September 6, 2024, 6:52am
5
thanks @Olaf !!
With your help , I find out the answer is …
Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase | Where-Object { $_.ProductName -Match “^Power.*” }
Have nice day
// Sokoban