Welcome to Microsoft Q&A again and thank you for posting your here!
To understand your question, you were asking where you can see the logs for this PowerShell command.
If you are using Windows PowerShell:
PowerShell logs can be viewed using the Windows Event Viewer. The event log is located in the Application and Services Logs group and is named Microsoft-Windows-PowerShell.
You can use the Get-EventLog cmdlet to get events and event logs from local and remote computers. By default, Get-EventLog gets logs from the local computer. To get logs from remote computers, use the ComputerName parameter.
You can also check Windows event logs with PowerShell using Get-EventLog. Event logs are stored in %SystemRoot%\System32\winevt\Logs, which usually translates into C:\Windows\System32\winevt\Logs. At least, that’s their default location, which can be easily changed by going to Action > Properties in the Event Viewer.
https://www.codetwo.com/admins-blog/how-to-check-event-logs-with-powershell-get-eventlog/
If you want to capture error messages thrown by a command in PowerShell script, you can use the $Error variable. The $Error variable contains an array of error objects that represent the most recent errors. The most recent error is at index 0.
https://stackoverflow.com/questions/17420474/how-to-capture-error-messages-thrown-by-a-command
If you are using Azure PowerShell:
Go to Azure Portal > the target Resource Group > Activity Log From the error message output, copy the OperationID and paste into the search box Click Apply Click on the resulting log item Click on JSON tab, search within text by the operation ID.
https://roykim.ca/2017/12/09/debugging-azure-powershell-with-activity-log/
You can use the Get-AzLog cmdlet to retrieve Activity Log events. The events can be associated with the current subscription ID, correlation ID, resource group, resource ID, or resource provider. You can also use the Get-EventLog cmdlet to get logs from the local computer or remote computers.
If you want to handle and log PowerShell errors, you can identify which commands need error handling in your function, CmdLet or script. You can set the ErrorAction parameter to value Stop for the command that needs error handling. This will stop executing the command when an error occurs and it will show the error message. The command that has ErrorAction parameter set to value Stop is wrapped in Try { } block.
https://www.improvescripting.com/how-to-log-powershell-errors-and-much-more/
I hope this helps! If this answer solves your issue, please vote for it so other community members know that this is a quality answer. PS: Do not hesitate to let me know if you have any other questions.
Best Regards,
Sina