PowerShell - Error Handling
You wrote this script:
But the script does not print 'File read successfully' when the file is missing. What is the fix?
Get-Content 'C:\missing.txt' -ErrorAction Stop
Write-Output 'File read successfully'
But the script does not print 'File read successfully' when the file is missing. What is the fix?
