This file contains hidden or 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
# Tage bis Nikolaus | |
cls | |
$nikolaus=New-Object System.DateTime(2013,12,6) | |
$today = Get-Date | |
$nikolausTag=$nikolaus.get_DayOfYear() | |
$todayTag=$today.get_DayOfYear() | |
Write-Host ("Es sind noch "+($nikolausTag-$todayTag)+" Tage bis Nikolaus") |
This file contains hidden or 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
cls | |
$d=Get-Content ("datum.html") | |
$i=1 | |
$t=Get-Date | |
foreach ($line in $d) { | |
if ($line -match "<h1>Heute ist der:") { | |
$line="<h1>Heute ist der: $t</h1>" | |
} | |
if ($i-eq 1) { | |
$line | Set-Content("datum.html") |
This file contains hidden or 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
$services = Get-Service | |
Get-Date | Set-Content info.txt | |
"Running Services" | Add-Content info.txt | |
foreach ($service in $services) { | |
if ($service.Status -like "Running") { | |
" "+$service.Name | add-Content info.txt | |
} | |
} |
This file contains hidden or 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
param ( | |
[int]$num=5 | |
) | |
cls | |
$a = Get-ChildItem -Recurse | |
$max = New-Object int[] $num | |
$maxNames = new-object String[] $num | |
foreach ($datei in $a) { | |
for ($i=0;$i -lt $num;$i++) { | |
if ($datei.Length -ge $max[$i]) { |
This file contains hidden or 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
param ( | |
$max=5 | |
) | |
cls | |
Get-ChildItem -Recurse | Sort-Object Length -Descending | Select-Object -First $max |
This file contains hidden or 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
cls | |
$d = Get-Content .\Geburtstage.csv | |
$filename = "geburtstage.ics" | |
"" | Set-Content $filename | |
$idcount=1; | |
foreach ($zeile in $d) { | |
$daten = $zeile.Split(";") | |
"BEGIN:VCALENDAR" | Add-Content $filename | |
"VERSION:2.0" | Add-Content $filename | |
"PRODID:http://www.mmbbs.de" | Add-Content $filename |
This file contains hidden or 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
cls | |
$gebtag=Read-Host "Dein Geburtstag (in der Form 11.April.1968)" | |
$geb = $gebtag.Split(".") | |
$webClient = new-object System.Net.WebClient | |
#$proxy = new-object System.Net.WebProxy "10.20.30.55:3128" | |
#$cred = New-Object System.Net.NetworkCredential 'veranstaltung', 'qwertz' | |
#$proxy.Credentials = $cred #(Get-Credential).GetNetworkCredential() | |
#$proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials | |
#$webclient.proxy=$proxy |
This file contains hidden or 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
cls | |
function dreh([String]$a) { | |
$out="" | |
for ($i=$a.Length-1;$i -ge 0;$i--) { | |
$out=$out+$a.Chars($i) | |
} | |
return $out | |
} | |
$a=dreh ("Hallo") |
This file contains hidden or 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
$global:klicks=0 | |
$myF = New-Object System.Windows.Forms.Form | |
$b = New-Object System.Windows.Forms.Button | |
$l = New-Object System.Windows.Forms.Label | |
$l.Text = "Klicks 0" | |
$l.Location="10,50" | |
$b.Text="Klick mich" | |
$b.Location="10,20" | |
$l.Add_MouseHover({ | |
$global:klicks=0 |
This file contains hidden or 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
function ipclass ([string]$ip) { | |
[array]$x = $ip.Split(".") | |
if($x[0] -le 127) | |
{ | |
return "A"; | |
} | |
if($x[0] -gt 127 -and $x[0] -le 191) | |
{ | |
return "B"; | |
} |
OlderNewer