-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added directory check plugin and updated README file * adding README * updated Changelog0 * added space at end of file * removed version * fixing up merge conflicts
- Loading branch information
1 parent
bc6443f
commit f9e38f4
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<# | ||
.SYNOPSIS | ||
Checks if directory exist | ||
.DESCRIPTION | ||
Checks if directory exist | ||
.Notes | ||
FileName : check-windows-directory.ps1 | ||
Author : Patrice White - [email protected] | ||
.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 | ||
} |