Sha256: a09b3897ffe75db703ef87425b0dc9c629b28349ba478f6dc220c171c92af98e

Contents?: true

Size: 749 Bytes

Versions: 5

Compression:

Stored size: 749 Bytes

Contents

<#
.SYNOPSIS 
    Checks if  directory exist
.DESCRIPTION
    Checks if directory exist
.Notes
    FileName    : check-windows-directory.ps1
    Author      : Patrice White - patrice.white@ge.com
.LINK 
    https://github.com/sensu-plugins/sensu-plugins-windows
.PARAMETER LogName 
    Required. The name of the directory.
    Example -Dir C:\Users\dir
.EXAMPLE
    powershell.exe -file check-windows-directory.ps1 -Dir C:\Users\dir
#>

[CmdletBinding()]
Param(
  [Parameter(Mandatory=$True)]
  [string]$Dir
)

$ThisDir = Test-Path -Path $Dir

#Shows diretory if it exist
if ($ThisDir) {
    "CheckDirectory OK: Directory exist"
    EXIT 0
}else {
    "CheckDirectory CRITICAL: Directory doesn't exist"
    EXIT 2
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sensu-plugins-windows-3.0.0 bin/powershell/check-windows-directory.ps1
sensu-plugins-windows-2.9.1 bin/powershell/check-windows-directory.ps1
sensu-plugins-windows-2.9.0 bin/powershell/check-windows-directory.ps1
sensu-plugins-windows-2.8.1 bin/powershell/check-windows-directory.ps1
sensu-plugins-windows-2.8.0 bin/powershell/check-windows-directory.ps1