I'm a bit stuck in one of the labs in the early chapters of the Learn Powershell in 30 lunches book.
Create a CliXML reference file for the services on your computer. Then, change the status of some non-essential service like BITS (stop it if itâ€™s already started; start it if itâ€™s stopped on your computer). Finally, use Diff to compare the reference CliXML file to the current state of your computerâ€™s services. Youâ€™ll need to specify more than the Name property for the comparisonâ€”does the -property parameter of Diff accept multiple values? How would you specify those multiple values?
My answer with lots of attempts and properties (which do support multiple values and seperated by a ',') is
diff -ref (import-clixml ref.xml) -diff (gsv)
but this fails to give an information and I'm struugling to determine which property to pull -property name doesn't add much more Thanks Mike
by nohandle at 2013-01-31 06:19:10
I don't own the book but I would answer like this:
â€”does the -property parameter of Diff accept multiple values?
Yes it accepts array of objects as input. (Get-Command Compare-Object | Select-Object -ExpandProperty parameters ).property.parameterType.name Object Or I can get the info from documentation using get-help -parameter
How would you specify those multiple values?
I would specify them as array of strings separated by the array operator -> ','.