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( | |
| [string]$filePath | |
| ) | |
| $filePath = Resolve-Path -Path $filePath | |
| if (-not (Test-Path $filePath)) { | |
| Write-Error "File does not exist: $filePath" | |
| exit 1 | |
| } |
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
| Get-NetTCPConnection -State Listen | Select-Object LocalAddress,LocalPort, @{Name='Process';Expression={(Get-Process -Id $_.OwningProcess).ProcessName}} | Sort-Object LocalPort |
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
| $outlook = New-Object -ComObject Outlook.Application | |
| $explorer = $outlook.ActiveExplorer() | |
| $selection = $explorer.Selection | |
| if ($selection.Count -eq 0) { | |
| Write-Error "No email selected." | |
| exit | |
| } | |
| $mail = $selection.Item(1) |
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
| Get-ChildItem -File | ForEach-Object { if ($_.Name -match '^(\d{2})\.(\d{2})\.(\d{4})\s+(.+)$') { $n = "$($matches[3])-$($matches[2])-$($matches[1]) $($matches[4])"; if (-not (Test-Path $n)) { Rename-Item -Path $_.FullName -NewName $n; Write-Host "✓ $($_.Name) -> $n" -ForegroundColor Green } } } |
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 NormalizeNonBreakingSpaceInBeck { | |
| try { | |
| $word = [Runtime.InteropServices.Marshal]::GetActiveObject("Word.Application") | |
| } catch { | |
| throw "Keine aktive Word-Instanz gefunden." | |
| } | |
| $doc = $word.ActiveDocument | |
| $wdFindContinue = 1 | |
| $wdReplaceAll = 2 |
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 ( | |
| [string]$FilePath, | |
| [Parameter(ValueFromRemainingArguments = $true)] | |
| [string[]]$Patterns | |
| ) | |
| if (-not (Test-Path $FilePath)) { | |
| Write-Error "'$FilePath' not found." | |
| exit 1 | |
| } |
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([Parameter(Mandatory=$true)][string]$InputFile) | |
| if (-not (Test-Path $InputFile)) { Write-Error "No '$InputFile'"; exit 1 } | |
| ffmpeg -i "$InputFile" -vn -b:a 64k $("$( [System.IO.Path]::ChangeExtension($InputFile, '.mp3') )") |
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 ( | |
| [string]$Pattern, | |
| [string]$Path | |
| ) | |
| if (-not (Test-Path $Path)) { | |
| Write-Error "File '$Path' not found." | |
| exit 1 | |
| } |
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
| gc $env:USERPROFILE\.ssh\id_ed25519.pub | ssh $args[0] "cat >> .ssh/authorized_keys" |
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 ( | |
| [string]$Query | |
| ) | |
| $apiKey = "" # https://console.cloud.google.com/apis/credentials | |
| $cseId = "" # https://programmablesearchengine.google.com/ | |
| $results = @() | |
| $encodedQuery = [System.Uri]::EscapeDataString($Query) |
NewerOlder