I have a command Get-Aduser -Filter 'Surname -like "Doe"' -properties * | Format-List
, but I’d like to use it with a Read-Host cmdlet using inline syntax. Something similar to
Get-Aduser -Filter 'Surname -like "{Read-Host -prompt "User surname?"}"' -properties * | Format-List
What is a correct syntax to do so? or the proper way to do so is to use a one-liners and the pipeline?