Tinus EngOps Wiki

Logo

OpsaC - Operating as PowerShell code

Links

Home

IT-Wiki

PowerShell Blog

PowerShell Index

PowerShell Search

Additional Websites

View my GitHub Profile

View my GitHub Gists

View my Codeberg Page

View my Photo Website

PowerShell als pwsh starten

published: May 30, 2024 author: Tinu tags: PowerShell categories: PowerShell


Aus einem Terminal kann die PowerShell 7 mit Parameters folgenderweise gestartet werden:

Code

pwsh.exe -command {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory=$true, Position = 0)]
        [String] $MyName,
		
	[Parameter(Mandatory=$true, Position = 1)]
        [String] $Language
    )
    Write-Host ('I am {0} an I love {1} {2}' -f $MyName, $Language, $PSVersionTable.PSVersion.ToString()) -ForegroundColor Green
} -args 'Tinu','PowerShell'

Output

I am Tinu an I love PowerShell 7.4.2


← Previous Post ◇ [ Top ] ◇ Copyright © 2024 by tinuwalther ◇ [ Blog ] ◇ Next Post →