PowerShell: Jaan Igamees, kavalskript: Difference between revisions
From ICO wiki
Jump to navigationJump to search
Blanked the page |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<Source lang="powershell"> | |||
<# | |||
.SYNOPSIS | |||
Yks 2raytlemata kaval skript | |||
.DESCRIPTION | |||
Proovi v6tmeid -Lause -Object -Arenenud | |||
.Example | |||
C:\PS>.\kaval1.ps1 -Lause "Tere ise ka" | |||
.NOTES | |||
Autor: Jaan Igamees | |||
Versioon: 0.1 | |||
Muutmise kuup2ev 31.01.2012 | |||
.LINK | |||
http://www.heiki.org | |||
http://www.eneta.ee | |||
#> | |||
param ([string]$Lause = "See on see, mida ma ütlen", | |||
[switch]$Object, | |||
[Switch]$Arenenud) | |||
if($object) | |||
{ | |||
if($Arenenud) | |||
{ | |||
$uus = New-Object PSObject | |||
$uus | add-member NoteProperty Sisu " " | |||
$uus | add-member NoteProperty MuutmiseAeg $null | |||
$uus.Sisu = $Lause | |||
$uus.MuutmiseAeg = Get-Date | |||
$uus | |||
} | |||
else | |||
{ | |||
$Lause | |||
} | |||
} | |||
else | |||
{ | |||
Write-host $Lause | |||
} | |||
</source> |
Latest revision as of 03:41, 31 January 2012
<#
.SYNOPSIS
Yks 2raytlemata kaval skript
.DESCRIPTION
Proovi v6tmeid -Lause -Object -Arenenud
.Example
C:\PS>.\kaval1.ps1 -Lause "Tere ise ka"
.NOTES
Autor: Jaan Igamees
Versioon: 0.1
Muutmise kuup2ev 31.01.2012
.LINK
http://www.heiki.org
http://www.eneta.ee
#>
param ([string]$Lause = "See on see, mida ma ütlen",
[switch]$Object,
[Switch]$Arenenud)
if($object)
{
if($Arenenud)
{
$uus = New-Object PSObject
$uus | add-member NoteProperty Sisu " "
$uus | add-member NoteProperty MuutmiseAeg $null
$uus.Sisu = $Lause
$uus.MuutmiseAeg = Get-Date
$uus
}
else
{
$Lause
}
}
else
{
Write-host $Lause
}