Skip to content

Instantly share code, notes, and snippets.

Avatar

Loïc MICHEL kayasax

View GitHub Profile
@kayasax
kayasax / Powershell Script Template.ps1
Last active Dec 22, 2015
Template for powershell script. Makes all errors "terminating" and send mail if error occurs
View Powershell Script Template.ps1
# Templata.ps1
# author: Loic MICHEL
# date: 10/09/2013
# abstract: make all errors terminating errors and send email + raise event in case of failure
#
[CmdletBinding()]param(
)
@kayasax
kayasax / parameters.ps1
Last active Jun 14, 2017
Exemple d'usage de PARAMETER
View parameters.ps1
[CmdletBinding()] #make script react as cmdlet (-verbose etc..)
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$service,
[Parameter(Position=1)]
[System.string]
$computername="local"