I am trying to Search a String from a Variable.
I am dumping Azure Activity Logs in a variable and trying to find a specific line for that log. Here is my codes below.
$log=Get-AzLog -ResourceId "/subscriptions/SubscriptionID/resourceGroups/ResourceGroupName/providers/Microsoft.Sql/servers/qcsqldw/databases/DatabaseName" -StartTime 2020-04-01T00:30
$find=$log | Select-String -Pattern 'Microsoft.Sql/servers/databases/resume/action'
Write-Output $find
I am trying to Search this Line "Action : Microsoft.Sql/servers/databases/resume/action" from the Log
While running the above script I did not got any output.
Please help me on this.
/pauseyet your code shows you wanting to match/resume. Since-patternuses regex matching, you don't need surrounding*characters because*is not a wildcard. The beginning*should throw an error since in regex*is a quantifier and there is nothing to quantify.