mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-09 10:04:45 +02:00
Improved the scripts
This commit is contained in:
parent
d5032a9d02
commit
87409780ff
@ -6,12 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$File = "")
|
param($File = "")
|
||||||
|
|
||||||
|
if ($File -eq "" ) {
|
||||||
|
$File = read-host "Enter path to file"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($File -eq "" ) {
|
|
||||||
$File = read-host "Enter path to file"
|
|
||||||
}
|
|
||||||
$Result = get-filehash $File -algorithm MD5
|
$Result = get-filehash $File -algorithm MD5
|
||||||
write-output "MD5 hash is" $Result.Hash
|
write-output "MD5 hash is" $Result.Hash
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -6,13 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$File = "")
|
param($File = "")
|
||||||
|
|
||||||
|
if ($File -eq "" ) {
|
||||||
|
$File = read-host "Enter the filename"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($File -eq "" ) {
|
|
||||||
$File = read-host "Enter file"
|
|
||||||
}
|
|
||||||
|
|
||||||
$Result = get-filehash $File -algorithm SHA1
|
$Result = get-filehash $File -algorithm SHA1
|
||||||
write-output "SHA1 hash is" $Result.Hash
|
write-output "SHA1 hash is" $Result.Hash
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -6,13 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$File = "")
|
param($File = "")
|
||||||
|
|
||||||
|
if ($File -eq "" ) {
|
||||||
|
$File = read-host "Enter the filename"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($File -eq "" ) {
|
|
||||||
$File = read-host "Enter file"
|
|
||||||
}
|
|
||||||
|
|
||||||
$Result = get-filehash $File -algorithm SHA256
|
$Result = get-filehash $File -algorithm SHA256
|
||||||
write-output "SHA256 hash is:" $Result.Hash
|
write-output "SHA256 hash is:" $Result.Hash
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Message)
|
param($Message = "")
|
||||||
|
|
||||||
if ($Message -eq "" ) {
|
if ($Message -eq "" ) {
|
||||||
$URL = read-host "Enter alert message"
|
$URL = read-host "Enter alert message"
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
|
|
||||||
param($DirTree = "")
|
param($DirTree = "")
|
||||||
|
|
||||||
try {
|
if ($DirTree -eq "" ) {
|
||||||
if ($DirTree -eq "" ) {
|
$DirTree = read-host "Enter the path to the directory tree"
|
||||||
$DirTree = read-host "Enter the path to the directory tree"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
try {
|
||||||
write-progress "Checking symlinks in $DirTree..."
|
write-progress "Checking symlinks in $DirTree..."
|
||||||
[int]$SymlinksTotal = [int]$SymlinksBroken = 0
|
[int]$SymlinksTotal = [int]$SymlinksBroken = 0
|
||||||
Get-ChildItem $DirTree -recurse | Where { $_.Attributes -match "ReparsePoint" } | ForEach-Object {
|
Get-ChildItem $DirTree -recurse | Where { $_.Attributes -match "ReparsePoint" } | ForEach-Object {
|
||||||
|
@ -8,10 +8,11 @@
|
|||||||
|
|
||||||
param($File = "")
|
param($File = "")
|
||||||
|
|
||||||
|
if ($File -eq "" ) {
|
||||||
|
$File = read-host "Enter path to XML file"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($File -eq "" ) {
|
|
||||||
$File = read-host "Enter path to XML file"
|
|
||||||
}
|
|
||||||
$XmlFile = Get-Item $File
|
$XmlFile = Get-Item $File
|
||||||
|
|
||||||
$script:ErrorCount = 0
|
$script:ErrorCount = 0
|
||||||
|
@ -8,15 +8,15 @@
|
|||||||
|
|
||||||
param($FullProgramName = "", $ProgramName = "", $ProgramAliasName = "")
|
param($FullProgramName = "", $ProgramName = "", $ProgramAliasName = "")
|
||||||
|
|
||||||
try {
|
if ($ProgramName -eq "") {
|
||||||
if ($ProgramName -eq "") {
|
get-process | where-object {$_.mainWindowTitle} | format-table Id, Name, mainWindowtitle -AutoSize
|
||||||
get-process | where-object {$_.mainWindowTitle} | format-table Id, Name, mainWindowtitle -AutoSize
|
$ProgramName = read-host "Enter program name"
|
||||||
$ProgramName = read-host "Enter program name"
|
}
|
||||||
}
|
if ($FullProgramName -eq "") {
|
||||||
if ($FullProgramName -eq "") {
|
$FullProgramName = $ProgramName
|
||||||
$FullProgramName = $ProgramName
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
try {
|
||||||
$Processes = get-process -name $ProgramName -errorAction 'silentlycontinue'
|
$Processes = get-process -name $ProgramName -errorAction 'silentlycontinue'
|
||||||
if ($Processes.Count -ne 0) {
|
if ($Processes.Count -ne 0) {
|
||||||
foreach ($Process in $Processes) {
|
foreach ($Process in $Processes) {
|
||||||
|
@ -8,6 +8,16 @@
|
|||||||
|
|
||||||
param($FullName = "", $EmailAddress = "", $FavoriteEditor = "")
|
param($FullName = "", $EmailAddress = "", $FavoriteEditor = "")
|
||||||
|
|
||||||
|
if ($FullName -eq "") {
|
||||||
|
$FullName = read-host "Enter your full name"
|
||||||
|
}
|
||||||
|
if ($EmailAddress -eq "") {
|
||||||
|
$EmailAddress = read-host "Enter your e-mail address"
|
||||||
|
}
|
||||||
|
if ($FavoriteEditor -eq "") {
|
||||||
|
$FavoriteEditor = read-host "Enter your favorite text editor (emacs,nano,vi,vim,...)"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
& git --version
|
& git --version
|
||||||
} catch {
|
} catch {
|
||||||
@ -16,15 +26,6 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($FullName -eq "") {
|
|
||||||
$FullName = read-host "Enter your full name"
|
|
||||||
}
|
|
||||||
if ($EmailAddress -eq "") {
|
|
||||||
$EmailAddress = read-host "Enter your e-mail address"
|
|
||||||
}
|
|
||||||
if ($FavoriteEditor -eq "") {
|
|
||||||
$FavoriteEditor = read-host "Enter your favorite text editor (emacs,nano,vi,vim,...)"
|
|
||||||
}
|
|
||||||
& git config --global user.name $FullName
|
& git config --global user.name $FullName
|
||||||
& git config --global user.email $EmailAddress
|
& git config --global user.email $EmailAddress
|
||||||
& git config --global core.editor $FavoriteEditor
|
& git config --global core.editor $FavoriteEditor
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
|
|
||||||
param($Symlink = "", $Target = "")
|
param($Symlink = "", $Target = "")
|
||||||
|
|
||||||
try {
|
if ($Symlink -eq "" ) {
|
||||||
if ($Symlink -eq "" ) {
|
$Symlink = read-host "Enter filename of symlink"
|
||||||
$Symlink = read-host "Enter filename of symlink"
|
}
|
||||||
}
|
if ($Target -eq "" ) {
|
||||||
if ($Target -eq "" ) {
|
$Target = read-host "Enter path to target"
|
||||||
$Target = read-host "Enter path to target"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
try {
|
||||||
new-item -path "$Symlink" -itemType SymbolicLink -Value "$Target"
|
new-item -path "$Symlink" -itemType SymbolicLink -Value "$Target"
|
||||||
|
|
||||||
write-host -foregroundColor green "Done."
|
write-host -foregroundColor green "Done."
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
|
|
||||||
param([String]$Path)
|
param([String]$Path)
|
||||||
|
|
||||||
try {
|
if ($Path -eq "" ) {
|
||||||
if ($Path -eq "" ) {
|
$Path = read-host "Enter path to CSV file"
|
||||||
$Path = read-host "Enter path to CSV file"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
try {
|
||||||
$Table = Import-CSV -path "$Path" -header A,B,C,D,E,F,G,H
|
$Table = Import-CSV -path "$Path" -header A,B,C,D,E,F,G,H
|
||||||
|
|
||||||
foreach($Row in $Table) {
|
foreach($Row in $Table) {
|
||||||
|
@ -8,6 +8,10 @@
|
|||||||
|
|
||||||
param($URL = "")
|
param($URL = "")
|
||||||
|
|
||||||
|
if ($URL -eq "" ) {
|
||||||
|
$URL = read-host "Enter URL to download"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
& wget --version
|
& wget --version
|
||||||
} catch {
|
} catch {
|
||||||
@ -16,10 +20,6 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($URL -eq "" ) {
|
|
||||||
$URL = read-host "Enter URL to download"
|
|
||||||
}
|
|
||||||
|
|
||||||
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $URL --directory-prefix . --no-verbose
|
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $URL --directory-prefix . --no-verbose
|
||||||
|
|
||||||
write-host -foregroundColor green "Done."
|
write-host -foregroundColor green "Done."
|
||||||
|
@ -8,13 +8,14 @@
|
|||||||
|
|
||||||
param($Text = "", $ImageSize = "")
|
param($Text = "", $ImageSize = "")
|
||||||
|
|
||||||
|
if ($Text -eq "") {
|
||||||
|
$Text = read-input "Enter text or URL"
|
||||||
|
}
|
||||||
|
if ($ImageSize -eq "") {
|
||||||
|
$ImageSize = read-input "Enter image size (e.g. 500x500)"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($Text -eq "") {
|
|
||||||
$Text = read-input "Enter text or URL"
|
|
||||||
}
|
|
||||||
if ($ImageSize -eq "") {
|
|
||||||
$ImageSize = read-input "Enter image size (e.g. 500x500)"
|
|
||||||
}
|
|
||||||
$ECC = "M" # can be L, M, Q, H
|
$ECC = "M" # can be L, M, Q, H
|
||||||
$QuietZone = 1
|
$QuietZone = 1
|
||||||
$ForegroundColor = "000000"
|
$ForegroundColor = "000000"
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$PathToExe)
|
param($PathToExe = "")
|
||||||
|
|
||||||
|
if ($PathToExe -eq "" ) {
|
||||||
|
$PathToExe = read-host "Enter path to executable file"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($PathToExe -eq "" ) {
|
|
||||||
$PathToExe = read-host "Enter path to executable file"
|
|
||||||
}
|
|
||||||
get-childitem $PathToExe | % {$_.VersionInfo} | Select *
|
get-childitem $PathToExe | % {$_.VersionInfo} | Select *
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Word, [int]$Columns = 8)
|
param($Word = "", [int]$Columns = 8)
|
||||||
|
|
||||||
function GetPermutations {
|
function GetPermutations {
|
||||||
[cmdletbinding()]
|
[cmdletbinding()]
|
||||||
|
@ -8,10 +8,11 @@
|
|||||||
|
|
||||||
param($DirTree = "")
|
param($DirTree = "")
|
||||||
|
|
||||||
|
if ($DirTree -eq "" ) {
|
||||||
|
$DirTree = read-host "Enter the path to the directory tree"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($DirTree -eq "" ) {
|
|
||||||
$DirTree = read-host "Enter the path to the directory tree"
|
|
||||||
}
|
|
||||||
write-progress "Listing empty directories in $DirTree..."
|
write-progress "Listing empty directories in $DirTree..."
|
||||||
[int]$Count = 0
|
[int]$Count = 0
|
||||||
Get-ChildItem $DirTree -recurse | Where {$_.PSIsContainer -eq $true} | Where {$_.GetFileSystemInfos().Count -eq 0} | ForEach-Object {
|
Get-ChildItem $DirTree -recurse | Where {$_.PSIsContainer -eq $true} | Where {$_.GetFileSystemInfos().Count -eq 0} | ForEach-Object {
|
||||||
|
@ -8,10 +8,11 @@
|
|||||||
|
|
||||||
param($DirTree = "")
|
param($DirTree = "")
|
||||||
|
|
||||||
|
if ($DirTree -eq "" ) {
|
||||||
|
$DirTree = read-host "Enter the path to the directory tree"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($DirTree -eq "" ) {
|
|
||||||
$DirTree = read-host "Enter the path to the directory tree"
|
|
||||||
}
|
|
||||||
[int]$Count = 0
|
[int]$Count = 0
|
||||||
write-progress "Listing empty files in $DirTree ..."
|
write-progress "Listing empty files in $DirTree ..."
|
||||||
get-childItem $DirTree -recurse | where {$_.PSIsContainer -eq $false} | where {$_.Length -eq 0} | foreach-object {
|
get-childItem $DirTree -recurse | where {$_.PSIsContainer -eq $false} | where {$_.Length -eq 0} | foreach-object {
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Folder)
|
param($Folder = "")
|
||||||
|
|
||||||
|
if ($Folder -eq "" ) {
|
||||||
|
$Folder = read-host "Enter path to folder"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($Folder -eq "" ) {
|
|
||||||
[string]$Folder = read-host "Enter path to folder"
|
|
||||||
}
|
|
||||||
Get-ChildItem -path $Folder -recurse | select FullName
|
Get-ChildItem -path $Folder -recurse | select FullName
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Dir = "")
|
param($Dir = "")
|
||||||
|
|
||||||
function ListDirectory { param([string]$Path)
|
function ListDirectory { param([string]$Path)
|
||||||
$Items = get-childItem -path $Path
|
$Items = get-childItem -path $Path
|
||||||
|
@ -8,13 +8,15 @@
|
|||||||
|
|
||||||
#Requires -Version 3
|
#Requires -Version 3
|
||||||
|
|
||||||
param([string]$Username = "", [string]$Password = "")
|
param($Username = "", $Password = "")
|
||||||
|
|
||||||
if ($Username -eq "") {
|
if ($Username -eq "") {
|
||||||
$Username = read-host "Enter username for FRITZ!Box"
|
$Username = read-host "Enter username for FRITZ!Box"
|
||||||
}
|
}
|
||||||
if ($Password -eq "") {
|
if ($Password -eq "") {
|
||||||
$Password = read-host "Enter password for FRITZ!Box"
|
$Password = read-host "Enter password for FRITZ!Box"
|
||||||
}
|
}
|
||||||
|
|
||||||
write-progress "Contacting FRITZ!Box ..."
|
write-progress "Contacting FRITZ!Box ..."
|
||||||
$FQDN = "fritz.box"
|
$FQDN = "fritz.box"
|
||||||
|
|
||||||
|
@ -8,13 +8,15 @@
|
|||||||
|
|
||||||
#Requires -Version 3
|
#Requires -Version 3
|
||||||
|
|
||||||
param([string]$Username = "", [string]$Password = "")
|
param($Username = "", $Password = "")
|
||||||
|
|
||||||
if ($Username -eq "") {
|
if ($Username -eq "") {
|
||||||
$Username = read-host "Enter username for FRITZ!Box"
|
$Username = read-host "Enter username for FRITZ!Box"
|
||||||
}
|
}
|
||||||
if ($Password -eq "") {
|
if ($Password -eq "") {
|
||||||
$Password = read-host "Enter password for FRITZ!Box"
|
$Password = read-host "Enter password for FRITZ!Box"
|
||||||
}
|
}
|
||||||
|
|
||||||
write-progress "Contacting FRITZ!Box ..."
|
write-progress "Contacting FRITZ!Box ..."
|
||||||
[string]$HostURL = "https://fritz.box:49443"
|
[string]$HostURL = "https://fritz.box:49443"
|
||||||
[string]$SOAPAction="urn:dslforum-org:service:Hosts:1#X_AVM-DE_GetHostListPath"
|
[string]$SOAPAction="urn:dslforum-org:service:Hosts:1#X_AVM-DE_GetHostListPath"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$RSS_URL = "https://yahoo.com/news/rss/world")
|
param($RSS_URL = "https://yahoo.com/news/rss/world")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
[xml]$Content = (invoke-webRequest -URI $RSS_URL).Content
|
[xml]$Content = (invoke-webRequest -URI $RSS_URL).Content
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$DirTree, [int]$NumberOfDaysUnused)
|
param($DirTree = "", [int]$NumberOfDaysUnused = 99)
|
||||||
|
|
||||||
write-host "Listing files in $DirTree with last access time older than $NumberOfDaysUnused days"
|
write-host "Listing files in $DirTree with last access time older than $NumberOfDaysUnused days"
|
||||||
|
|
||||||
|
@ -6,10 +6,12 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$City)
|
param($City = "")
|
||||||
|
|
||||||
if ($City -eq "" ) {
|
if ($City -eq "" ) {
|
||||||
$City = read-host "Enter the city"
|
$City = read-host "Enter the city name"
|
||||||
}
|
}
|
||||||
|
|
||||||
$PathToRepo = "$PSScriptRoot/.."
|
$PathToRepo = "$PSScriptRoot/.."
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -7,10 +7,12 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
param($IPaddr = "")
|
param($IPaddr = "")
|
||||||
|
|
||||||
|
if ($IPaddr -eq "" ) {
|
||||||
|
$IPaddr = read-host "Enter IP address to locate"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($IPaddr -eq "" ) {
|
|
||||||
$IPaddr = read-host "Enter IP address to locate"
|
|
||||||
}
|
|
||||||
$result = Invoke-RestMethod -Method Get -Uri "http://ip-api.com/json/$IPaddr"
|
$result = Invoke-RestMethod -Method Get -Uri "http://ip-api.com/json/$IPaddr"
|
||||||
write-output $result
|
write-output $result
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -6,18 +6,18 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$CountryCode = "", [string]$ZipCode = "")
|
param($CountryCode = "", $ZipCode = "")
|
||||||
$PathToRepo = "$PSScriptRoot/.."
|
|
||||||
|
if ($CountryCode -eq "" ) {
|
||||||
|
$CountryCode = read-host "Enter the country code"
|
||||||
|
}
|
||||||
|
if ($ZipCode -eq "" ) {
|
||||||
|
$ZipCode = read-host "Enter the zip code"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($CountryCode -eq "" ) {
|
|
||||||
$CountryCode = read-host "Enter the country code"
|
|
||||||
}
|
|
||||||
if ($ZipCode -eq "" ) {
|
|
||||||
$ZipCode = read-host "Enter the zip code"
|
|
||||||
}
|
|
||||||
|
|
||||||
write-progress "Reading zip-codes.csv..."
|
write-progress "Reading zip-codes.csv..."
|
||||||
|
$PathToRepo = "$PSScriptRoot/.."
|
||||||
$Table = import-csv "$PathToRepo/Data/zip-codes.csv"
|
$Table = import-csv "$PathToRepo/Data/zip-codes.csv"
|
||||||
|
|
||||||
$FoundOne = 0
|
$FoundOne = 0
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$EmailAddress = "")
|
param($EmailAddress = "")
|
||||||
|
|
||||||
|
if ($EmailAddress -eq "" ) {
|
||||||
|
$EmailAddress = "markus@fleschutz.de"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($EmailAddress -eq "" ) {
|
|
||||||
$EmailAddress = "markus@fleschutz.de"
|
|
||||||
}
|
|
||||||
$URL="mailto:$EmailAddress"
|
$URL="mailto:$EmailAddress"
|
||||||
Start-Process $URL
|
Start-Process $URL
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$URL = "")
|
param($URL = "")
|
||||||
|
|
||||||
|
if ($URL -eq "" ) {
|
||||||
|
$URL = "http://www.fleschutz.de"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($URL -eq "" ) {
|
|
||||||
$URL = "http://www.fleschutz.de"
|
|
||||||
}
|
|
||||||
Start-Process $URL
|
Start-Process $URL
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -8,10 +8,11 @@
|
|||||||
|
|
||||||
param($Filename = "")
|
param($Filename = "")
|
||||||
|
|
||||||
|
if ($Filename -eq "" ) {
|
||||||
|
$Filename = read-host "Enter the M3U playlist filename"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($Filename -eq "" ) {
|
|
||||||
$Filename = read-host "Enter the M3U playlist filename"
|
|
||||||
}
|
|
||||||
$Lines = get-content $Filename
|
$Lines = get-content $Filename
|
||||||
|
|
||||||
add-type -assemblyName presentationCore
|
add-type -assemblyName presentationCore
|
||||||
|
@ -8,10 +8,11 @@
|
|||||||
|
|
||||||
param($Filename = "")
|
param($Filename = "")
|
||||||
|
|
||||||
|
if ($Filename -eq "" ) {
|
||||||
|
$Filename = read-host "Enter the MP3 filename"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($Filename -eq "" ) {
|
|
||||||
$Filename = read-host "Enter the MP3 filename"
|
|
||||||
}
|
|
||||||
add-type -assemblyName presentationCore
|
add-type -assemblyName presentationCore
|
||||||
$MediaPlayer = new-object system.windows.media.mediaplayer
|
$MediaPlayer = new-object system.windows.media.mediaplayer
|
||||||
$MediaPlayer.open("$Filename")
|
$MediaPlayer.open("$Filename")
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#Requires -RunAsAdministrator
|
#Requires -RunAsAdministrator
|
||||||
|
|
||||||
param([string]$Directory = "")
|
param($Directory = "")
|
||||||
|
|
||||||
|
|
||||||
function CheckIfInstalled {
|
function CheckIfInstalled {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$USERNAME = "", [string]$PASSWORD = "")
|
param($USERNAME = "", $PASSWORD = "")
|
||||||
if ($USERNAME -eq "") {
|
if ($USERNAME -eq "") {
|
||||||
$USERNAME = read-host "Enter username for FRITZ!Box"
|
$USERNAME = read-host "Enter username for FRITZ!Box"
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Pattern = "", [string]$Path = "")
|
param($Pattern = "", $Path = "")
|
||||||
|
|
||||||
function ListScripts { param([string]$Pattern, [string]$Path)
|
function ListScripts { param([string]$Pattern, [string]$Path)
|
||||||
$List = Select-String -Path $Path -Pattern "$Pattern"
|
$List = Select-String -Path $Path -Pattern "$Pattern"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$TargetIP = "", [int]$TargetPort = 0, [string]$Message = "")
|
param($TargetIP = "", [int]$TargetPort = 0, $Message = "")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($TargetIP -eq "" ) {
|
if ($TargetIP -eq "" ) {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$TargetIP = "", [int]$TargetPort = 0, [string]$Message = "")
|
param($TargetIP = "", [int]$TargetPort = 0, $Message = "")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($TargetIP -eq "" ) {
|
if ($TargetIP -eq "" ) {
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
|
|
||||||
param([int]$Seconds = 0)
|
param([int]$Seconds = 0)
|
||||||
|
|
||||||
try {
|
if ($Seconds -eq 0 ) {
|
||||||
if ($Seconds -eq 0 ) {
|
[int]$Seconds = read-host "Enter number of seconds"
|
||||||
[int]$Seconds = read-host "Enter number of seconds"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
try {
|
||||||
for ($i = $Seconds; $i -gt 0; $i--) {
|
for ($i = $Seconds; $i -gt 0; $i--) {
|
||||||
clear-host
|
clear-host
|
||||||
./write-big "T-$i seconds"
|
./write-big "T-$i seconds"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$ImageFile = "", [string]$Style = "Fit")
|
param($ImageFile = "", $Style = "Fit")
|
||||||
|
|
||||||
function SetWallPaper {
|
function SetWallPaper {
|
||||||
param([string]$Image, [ValidateSet('Fill', 'Fit', 'Stretch', 'Tile', 'Center', 'Span')][string]$Style)
|
param([string]$Image, [ValidateSet('Fill', 'Fit', 'Stretch', 'Tile', 'Center', 'Span')][string]$Style)
|
||||||
|
@ -8,10 +8,11 @@
|
|||||||
|
|
||||||
param($IPaddress = "")
|
param($IPaddress = "")
|
||||||
|
|
||||||
|
if ($IPaddress -eq "" ) {
|
||||||
|
$IPaddress = read-host "Enter IP address of Shelly1 device"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($IPaddress -eq "" ) {
|
|
||||||
$IPaddress = read-host "Enter IP address of Shelly1 device"
|
|
||||||
}
|
|
||||||
for ([int]$i = 0; $i -lt 1000; $i++) {
|
for ([int]$i = 0; $i -lt 1000; $i++) {
|
||||||
& ./switch-shelly1.ps1 $IPaddress on 0
|
& ./switch-shelly1.ps1 $IPaddress on 0
|
||||||
start-sleep -s 10
|
start-sleep -s 10
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Directory = "")
|
param($Directory = "")
|
||||||
|
|
||||||
function WriteCsvHeader { param([PSCustomObject]$File)
|
function WriteCsvHeader { param([PSCustomObject]$File)
|
||||||
foreach($Entry in $File.ata_smart_attributes.table) {
|
foreach($Entry in $File.ata_smart_attributes.table) {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Filename = "")
|
param($Filename = "")
|
||||||
|
|
||||||
function Speak { param([string]$Text)
|
function Speak { param([string]$Text)
|
||||||
write-output "$Text"
|
write-output "$Text"
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$File = "")
|
param($File = "")
|
||||||
|
|
||||||
|
if ($File -eq "") {
|
||||||
|
$File = read-host "Enter path to text file"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($File -eq "") {
|
|
||||||
$File = read-host "Enter path to text file"
|
|
||||||
}
|
|
||||||
$Text = Get-Content $File
|
$Text = Get-Content $File
|
||||||
|
|
||||||
$Voice = new-object -ComObject SAPI.SPVoice
|
$Voice = new-object -ComObject SAPI.SPVoice
|
||||||
|
@ -8,15 +8,16 @@
|
|||||||
|
|
||||||
param($Text = "")
|
param($Text = "")
|
||||||
|
|
||||||
|
if ($Text -eq "") {
|
||||||
|
$Text = read-host "Enter the text to speak"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$Voice = new-object -ComObject SAPI.SPVoice
|
$Voice = new-object -ComObject SAPI.SPVoice
|
||||||
$Voices = $Voice.GetVoices()
|
$Voices = $Voice.GetVoices()
|
||||||
foreach ($OtherVoice in $Voices) {
|
foreach ($OtherVoice in $Voices) {
|
||||||
$Description = $OtherVoice.GetDescription()
|
$Description = $OtherVoice.GetDescription()
|
||||||
if ($Description -like "*- German*") {
|
if ($Description -like "*- German*") {
|
||||||
if ($Text -eq "") {
|
|
||||||
$Text = read-host "Enter the text to speak"
|
|
||||||
}
|
|
||||||
write-progress "$Text"
|
write-progress "$Text"
|
||||||
$Voice.Voice = $OtherVoice
|
$Voice.Voice = $OtherVoice
|
||||||
[void]$Voice.Speak($Text)
|
[void]$Voice.Speak($Text)
|
||||||
|
@ -6,13 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "")
|
param($Text = "")
|
||||||
|
|
||||||
|
if ($Text -eq "") {
|
||||||
|
$Text = read-host "Enter the text to speak"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($Text -eq "") {
|
|
||||||
$Text = read-host "Enter the text to speak"
|
|
||||||
}
|
|
||||||
|
|
||||||
$Voice = new-object -ComObject SAPI.SPVoice
|
$Voice = new-object -ComObject SAPI.SPVoice
|
||||||
$Result = $Voice.Speak($Text)
|
$Result = $Voice.Speak($Text)
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -8,6 +8,10 @@
|
|||||||
|
|
||||||
param($Branch = "")
|
param($Branch = "")
|
||||||
|
|
||||||
|
if ($Branch -eq "") {
|
||||||
|
$Branch = read-host "Enter branch name to switch to"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
& git --version
|
& git --version
|
||||||
} catch {
|
} catch {
|
||||||
@ -16,10 +20,6 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($Branch -eq "") {
|
|
||||||
$Branch = read-host "Enter branch name to switch to"
|
|
||||||
}
|
|
||||||
|
|
||||||
& git switch --recurse-submodules $Branch
|
& git switch --recurse-submodules $Branch
|
||||||
if ($lastExitCode -ne "0") { throw "'git switch --recurse-submodules $Branch' failed" }
|
if ($lastExitCode -ne "0") { throw "'git switch --recurse-submodules $Branch' failed" }
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Directory = "")
|
param($Directory = "")
|
||||||
|
|
||||||
function TakeScreenshot { param([string]$FilePath)
|
function TakeScreenshot { param([string]$FilePath)
|
||||||
Add-Type -Assembly System.Windows.Forms
|
Add-Type -Assembly System.Windows.Forms
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Directory = "", [int]$Interval = 60)
|
param($Directory = "", [int]$Interval = 60)
|
||||||
|
|
||||||
function TakeScreenshot { param([string]$FilePath)
|
function TakeScreenshot { param([string]$FilePath)
|
||||||
Add-Type -Assembly System.Windows.Forms
|
Add-Type -Assembly System.Windows.Forms
|
||||||
|
@ -8,19 +8,19 @@
|
|||||||
|
|
||||||
param($File = "", $SourceLanguage = "", $TargetLanguage = "")
|
param($File = "", $SourceLanguage = "", $TargetLanguage = "")
|
||||||
|
|
||||||
|
if ($File -eq "" ) {
|
||||||
|
$File = read-host "Enter path to file"
|
||||||
|
}
|
||||||
|
if ($SourceLanguage -eq "" ) {
|
||||||
|
$SourceLanguage = read-host "Enter language of this file"
|
||||||
|
}
|
||||||
|
if ($TargetLanguage -eq "" ) {
|
||||||
|
$TargetLanguage = read-host "Enter language to translate to"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$PathToRepo = "$PSScriptRoot/.."
|
$PathToRepo = "$PSScriptRoot/.."
|
||||||
|
|
||||||
if ($File -eq "" ) {
|
|
||||||
$File = read-host "Enter path to file"
|
|
||||||
}
|
|
||||||
if ($SourceLanguage -eq "" ) {
|
|
||||||
$SourceLanguage = read-host "Enter language of this file"
|
|
||||||
}
|
|
||||||
if ($TargetLanguage -eq "" ) {
|
|
||||||
$TargetLanguage = read-host "Enter language to translate to"
|
|
||||||
}
|
|
||||||
|
|
||||||
Start-Process -FilePath "$PathToRepo/Data/trans" -ArgumentList "-i $File -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait
|
Start-Process -FilePath "$PathToRepo/Data/trans" -ArgumentList "-i $File -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -8,6 +8,10 @@
|
|||||||
|
|
||||||
param($Directory = "")
|
param($Directory = "")
|
||||||
|
|
||||||
|
if ($Directory -eq "") {
|
||||||
|
$Directory = "$PWD"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
& git --version
|
& git --version
|
||||||
} catch {
|
} catch {
|
||||||
@ -16,9 +20,6 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($Directory -eq "") {
|
|
||||||
$Directory = "$PWD"
|
|
||||||
}
|
|
||||||
$Files = get-childItem -path $Directory
|
$Files = get-childItem -path $Directory
|
||||||
foreach ($File in $Files) {
|
foreach ($File in $Files) {
|
||||||
if ($File.Mode -like "d*") {
|
if ($File.Mode -like "d*") {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$DirTree = "")
|
param($DirTree = "")
|
||||||
|
|
||||||
function VisualizeDirectory { param([string]$Directory, [int]$Depth)
|
function VisualizeDirectory { param([string]$Directory, [int]$Depth)
|
||||||
$Depth++
|
$Depth++
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$MACaddress = "", [string]$IPaddress = "")
|
param($MACaddress = "", $IPaddress = "")
|
||||||
|
|
||||||
function Send-WOL { param([string]$mac, [string]$ip="255.255.255.255", [int]$port=9)
|
function Send-WOL { param([string]$mac, [string]$ip="255.255.255.255", [int]$port=9)
|
||||||
$broadcast = [Net.IPAddress]::Parse($ip)
|
$broadcast = [Net.IPAddress]::Parse($ip)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "")
|
param($Text = "")
|
||||||
|
|
||||||
Set-StrictMode -Version Latest
|
Set-StrictMode -Version Latest
|
||||||
|
|
||||||
|
@ -8,10 +8,11 @@
|
|||||||
|
|
||||||
param($Text = "")
|
param($Text = "")
|
||||||
|
|
||||||
|
if ($Text -eq "" ) {
|
||||||
|
$Text = read-host "Enter the text to write"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($Text -eq "" ) {
|
|
||||||
[String]$Text = read-host "Enter text to write"
|
|
||||||
}
|
|
||||||
write-host -foregroundColor blue $Text
|
write-host -foregroundColor blue $Text
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "")
|
param($Text = "")
|
||||||
|
|
||||||
function BrailleA { param([int]$Row)
|
function BrailleA { param([int]$Row)
|
||||||
switch($Row) {
|
switch($Row) {
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "")
|
param($Text = "")
|
||||||
|
|
||||||
|
if ($Text -eq "" ) {
|
||||||
|
$Text = read-host "Enter the text to write"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($Text -eq "" ) {
|
|
||||||
[string]$Text = read-host "Enter text to write"
|
|
||||||
}
|
|
||||||
write-host -foregroundColor green $Text
|
write-host -foregroundColor green $Text
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -6,14 +6,15 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "")
|
param($Text = "")
|
||||||
|
|
||||||
|
if ($Text -eq "" ) {
|
||||||
|
$Text = read-host "Enter the text to write"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$Time = get-date -format "yyyy-MM-ddTHH:mm:ssZ" -asUTC
|
$Time = get-date -format "yyyy-MM-ddTHH:mm:ssZ" -asUTC
|
||||||
$User = $(whoami)
|
$User = $(whoami)
|
||||||
if ($Text -eq "" ) {
|
|
||||||
[string]$Text = read-host "Enter text to write"
|
|
||||||
}
|
|
||||||
$Line = "$Time,$User,$Text"
|
$Line = "$Time,$User,$Text"
|
||||||
|
|
||||||
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
|
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
|
||||||
|
@ -6,10 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "", [int]$Speed = 60) # 60 ms pause
|
param($Text = "PowerShell is powerful! PowerShell is cross-platform! PowerShell is open-source! PowerShell is easy to learn! Powershell is fully documented", [int]$Speed = 60) # 60 ms pause
|
||||||
if ($Text -eq "") {
|
|
||||||
$Text = "PowerShell is powerful! PowerShell is cross-platform! PowerShell is open-source! PowerShell is easy to learn! Powershell is fully documented"
|
|
||||||
}
|
|
||||||
|
|
||||||
function StartMarquee { param([string]$text)
|
function StartMarquee { param([string]$text)
|
||||||
$Length = $text.Length
|
$Length = $text.Length
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "", [int]$OneTimeUnit = 100) # in milliseconds
|
param($Text = "", [int]$OneTimeUnit = 100) # in milliseconds
|
||||||
|
|
||||||
function gap { param([int]$Length)
|
function gap { param([int]$Length)
|
||||||
for ([int]$i = 1; $i -lt $Length; $i++) {
|
for ([int]$i = 1; $i -lt $Length; $i++) {
|
||||||
|
@ -6,15 +6,11 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "")
|
param($Text = "")
|
||||||
|
|
||||||
try {
|
if ($Text -eq "" ) {
|
||||||
if ($Text -eq "" ) {
|
$Text = read-host "Enter the text to write"
|
||||||
[string]$Text = read-host "Enter text to write"
|
|
||||||
}
|
|
||||||
write-host -foregroundcolor red $Text
|
|
||||||
exit 0
|
|
||||||
} catch {
|
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
|
||||||
exit 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
write-host -foregroundcolor red $Text
|
||||||
|
exit 0
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "")
|
param($Text = "")
|
||||||
|
|
||||||
function ROT13 { param([string]$Text)
|
function ROT13 { param([string]$Text)
|
||||||
$Text.ToCharArray() | ForEach-Object {
|
$Text.ToCharArray() | ForEach-Object {
|
||||||
|
@ -6,11 +6,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "", [int]$Speed = 250) # in milliseconds
|
param($Text = "`nHello World`n-----------`nPowerShell is cross-platform`nPowerShell is open-source`nPowerShell is easy to learn`nPowerShell is fully documented`n`nThanks for watching`n`n:-)`n`n", [int]$Speed = 250) # in milliseconds
|
||||||
|
|
||||||
if ($Text -eq "" ) {
|
|
||||||
$Text = "`nHello World`n-----------`nPowerShell is cross-platform`nPowerShell is open-source`nPowerShell is easy to learn`nPowerShell is fully documented`n`nThanks for watching`n`n:-)`n`n"
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$Random = New-Object System.Random
|
$Random = New-Object System.Random
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "")
|
param($Text = "")
|
||||||
|
|
||||||
|
if ($Text -eq "" ) {
|
||||||
|
$Text = read-host "Enter the text to write"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($Text -eq "" ) {
|
|
||||||
[string]$Text = read-host "Enter text to write"
|
|
||||||
}
|
|
||||||
write-output $Text.ToUpper()
|
write-output $Text.ToUpper()
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "")
|
param($Text = "")
|
||||||
|
|
||||||
|
if ($Text -eq "" ) {
|
||||||
|
$Text = read-host "Enter the text to write"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($Text -eq "" ) {
|
|
||||||
[String]$Text = read-host "Enter text to write"
|
|
||||||
}
|
|
||||||
[char[]]$TextArray = $Text
|
[char[]]$TextArray = $Text
|
||||||
foreach($Char in $TextArray) {
|
foreach($Char in $TextArray) {
|
||||||
write-output $Char
|
write-output $Char
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
|
|
||||||
param($Directory = "")
|
param($Directory = "")
|
||||||
|
|
||||||
try {
|
if ($Directory -eq "" ) {
|
||||||
if ($Directory -eq "" ) {
|
$Directory = read-host "Enter the path to the directory to zip"
|
||||||
$Directory = read-host "Enter path to directory to zip"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
try {
|
||||||
compress-archive -path $Directory -destinationPath $Directory.zip
|
compress-archive -path $Directory -destinationPath $Directory.zip
|
||||||
|
|
||||||
write-host -foregroundColor green "Done - created zip archive $($Directory).zip"
|
write-host -foregroundColor green "Done - created zip archive $($Directory).zip"
|
||||||
|
Loading…
Reference in New Issue
Block a user