View only Product

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

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 :point_up_2:t4: :wink:

( !! Sometimes the preformatted text button hides behind the settings gear symbol. :wink: )

Instead of the misstyped Select-Object

… you should use a Where-Object to filter for the objects or properties you’re after. :wink::point_up:t3:

image

There is no command with the name -Where-Object …

Of course not. :man_shrugging:t3: The names of PowerShell cmdlets have the format “Verb-Noun” … no dash in front of the verb!! :point_up:t3:

So the name of the command is Where-Object … here you can read more about:

1 Like

thanks @Olaf !!

With your help , I find out the answer is …

Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase | Where-Object { $_.ProductName -Match “^Power.*” }

Have nice day

// Sokoban