# Funktionen und Module

> Wiederverwendbare Automatisierung mit klaren Parametern, Ausgabe und Versionsgrenzen.

Track: [PowerShell & Betriebsautomatisierung](https://physar.tech/learn/powershell-automation)  
Kanonische Fassung: https://physar.tech/learn/powershell-automation/functions-and-modules  
Stand: 2026-07-29  
Interaktiver Teil: 3 Checks (nur im Browser)

## Automatisierung als Schnittstelle

### Die Betriebsfrage

Eine Funktion ist erst dann sicher wiederverwendbar, wenn ihre Eingabe, Ausgabe, Fehler und Nebenwirkungen erkennbar sind.

> **Lernziel:** Du kannst einen Einmalbefehl in eine testbare Funktion mit stabiler Schnittstelle überführen.

### Vertrag

Zweck und Sollzustand benennen → Parameter validieren → Objektergebnis und Fehler definieren → Versioniert veröffentlichen

## Quellen

- learn.microsoft.com/en-us/powershell/module/mi…bout/about_functions — https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions?view=powershell-7.5
- learn.microsoft.com/en-us/powershell/gallery/h…publishing-a-package — https://learn.microsoft.com/en-us/powershell/gallery/how-to/publishing-packages/publishing-a-package
- learn.microsoft.com/en-us/powershell/module/mi…/about/about_modules — https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_modules
