I have used the code below to get all lines from content $ProjectFileContents that has "<PackageReference Include"
$ProjectFileContents | Find "<PackageReference Include" | Sort-Object -Unique
However when I try to get another line from the same content $ProjectFileContents that has "<OutputType", it returns an error
$ProjectFileContents | Find "<PackageReference Include" | Sort-Object -Unique
Error Gotten
Find : FIND: Parameter format not correct
At line:1 char:24
+ $ProjectFileContents | Find "OutputType" | Sort-Object -Unique
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (FIND: Parameter format not correct:String) [],
RemoteException
+ FullyQualifiedErrorId : NativeCommandError
I have used the same format I used initially however does not work for different set of strings. Any help will be appreciated. Thanks!!.