Skip to content
Snippets Groups Projects
Commit cddbcd84 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Make Get-Item call throw an exception on errors.

parent d0483be4
No related branches found
No related tags found
No related merge requests found
...@@ -137,7 +137,7 @@ function Start-MyService { ...@@ -137,7 +137,7 @@ function Start-MyService {
function Get-WriteTime([string]$FileName) { function Get-WriteTime([string]$FileName) {
try { try {
$TimeStamp = (Get-Item "$FileName").LastWriteTime $TimeStamp = (Get-Item "$FileName" -EA Stop).LastWriteTime
} }
catch { catch {
$ex = $_.Exception.Message $ex = $_.Exception.Message
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment