steps.pwsh definíció

A pwsh lépés egy szkriptet futtat a PowerShell Core-ban Windows, macOS és Linux rendszeren.

steps:
- pwsh: string # Required as first property. Inline PowerShell script.
  errorActionPreference: string # Unless otherwise specified, the error action preference defaults to the value stop. See the following section for more information.
  failOnStderr: string # Fail the task if output is sent to Stderr?
  ignoreLASTEXITCODE: string # Check the final exit code of the script to determine whether the step succeeded?
  workingDirectory: string # Start the script with this working directory.
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
  retryCountOnTaskFailure: string # Number of retries if the task fails.
steps:
- pwsh: string # Required as first property. Inline PowerShell script.
  errorActionPreference: string # Unless otherwise specified, the error action preference defaults to the value stop. See the following section for more information.
  failOnStderr: string # Fail the task if output is sent to Stderr?
  ignoreLASTEXITCODE: string # Check the final exit code of the script to determine whether the step succeeded?
  workingDirectory: string # Start the script with this working directory.
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
steps:
- pwsh: string # Required as first property. Inline PowerShell script.
  errorActionPreference: string # Unless otherwise specified, the error action preference defaults to the value stop. See the following section for more information.
  failOnStderr: string # Fail the task if output is sent to Stderr?
  ignoreLASTEXITCODE: string # Check the final exit code of the script to determine whether the step succeeded?
  workingDirectory: string # Start the script with this working directory.
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.

A definícióra hivatkozó definíciók: lépések

Tulajdonságok

pwsh Karakterlánc. Első tulajdonságként kötelező megadni.
Beágyazott PowerShell-szkript.

errorActionPreference Karakterlánc.
Ha másként nincs megadva, a hibaművelet beállításai alapértelmezés szerint az értékmegállításra lesznek beszüntetve. További információért tekintse meg az alábbi szakaszt.

failOnStderr Karakterlánc.
Sikertelen a feladat, ha a kimenetet a Stderrnek küldi?

ignoreLASTEXITCODE Karakterlánc.
Ellenőrizze a szkript végleges kilépési kódját annak megállapításához, hogy a lépés sikeres volt-e?

workingDirectory Karakterlánc.
Indítsa el a szkriptet ezzel a munkakönyvtárral.

condition Karakterlánc.
Értékelje ki ezt a feltételkifejezést, és állapítsa meg, hogy futtatni kívánja-e ezt a feladatot.

continueOnErrorlogikai érték.
Továbbra is fut a hiba esetén is?

displayName Karakterlánc.
A feladat emberi olvasásra alkalmas neve.

targetcél.
Környezet, amelyben futtatni szeretné ezt a feladatot.

enabledlogikai érték.
Futtassa ezt a feladatot a feladat futtatásakor?

env sztringszótár.
Változók a folyamat környezetébe való leképezéshez.

name Karakterlánc.
A lépés azonosítója. Elfogadható értékek: [-_A-Za-z0-9]*.

timeoutInMinutes Karakterlánc.
Ideje megvárni, amíg a feladat befejeződik, mielőtt a kiszolgáló leáll.

Megjegyzés

Előfordulhat, hogy a folyamatok feladatszintű időtúllépéssel konfigurálhatók. Ha a feladatszint időtúllépési időköze a lépés befejezése előtt eltelik, a futó feladat (beleértve a lépést is) leáll, még akkor is, ha a lépés hosszabb timeoutInMinutes időközzel van konfigurálva. További információ: Időtúllépések.

retryCountOnTaskFailure Karakterlánc.
Újrapróbálkozások száma, ha a feladat meghiúsul.

Megjegyzések

A pwsh kulcsszó a PowerShell-tevékenység parancsikonja, ha a tevékenység pwsh értéke igaz értékre van állítva. A feladat futtat egy szkriptet a PowerShell Core-ban Windows, macOS és Linux rendszeren.

További információ a feltételekről és az időtúllépésekről.

Minden PowerShell-munkamenet csak annak a feladatnak az időtartamára tart, amelyben fut. A rendszerindítótól függő feladatoknak ugyanabban a feladatban kell lenniük, mint a bootstrapnak.

Példák

steps:
- pwsh: Write-Host Hello $($env:name)
  displayName: Say hello
  name: firstStep
  workingDirectory: $(build.sourcesDirectory)
  failOnStderr: true
  env:
    name: Microsoft

Lásd még