param($clusterName, $shareName)
$GenericFailureEvent = 5555
$api = New-Object -comObject 'MOM.ScriptAPI'
$bag = $api.CreatePropertyBag()
$IsOnline = Test-Path "\$clusterName$shareName"
$bag.AddValue("ShareName", $shareName)
IF ($IsOnline){
$bag.AddValue("State","Online") }
ELSE{
$bag.AddValue("State","Offline") }
if ($error -ne $null -and $error.Count -gt 0) { $api.LogScriptEvent("IsShareOnline.ps1", $GenericFailureEvent, 1, $error); }
$bag