Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'd like to test if a volume exists. I use if (get-navol $volume). If the volume not exists I get an error message even if I use a variable ($volexist = get-navol $volume). How can I test the volume without getting an error message on the console? Thanks in advance.
Stefan
Solved! See The Solution
1 ACCEPTED SOLUTION
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's one way...
PS C:\> if ( (Get-NaVol noSuchVol -ErrorAction SilentlyContinue) -eq $null ) { Write-Host "No such volume" }
No such volume
1 REPLY 1
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's one way...
PS C:\> if ( (Get-NaVol noSuchVol -ErrorAction SilentlyContinue) -eq $null ) { Write-Host "No such volume" }
No such volume
