atelier

PowerShell

parcours pratique pour apprendre PowerShell depuis zero

definition d abord

ce que signifie PowerShell

PowerShell sert a ecrire des instructions precises. Ici tu l abordes comme parcours pratique pour apprendre PowerShell depuis zero. Commence par une idee simple: des entrees passent par des etapes et deviennent une sortie.

infos minimalesfichier script.ps1executer pwsh script.ps1habitude apprends une petite piece de PowerShell, tape un exemple minimal et execute-le
programme

une suite d instructions executees dans un ordre clair.

valeur et variable

une valeur est une donnee. Une variable est le nom qui la garde.

fonction

un petit travail nomme qui recoit une entree et produit un resultat.

environnement

PowerShell 7 execute le code de script.ps1.

premier code lisible

sortie du programme

entry point output syntax Write-Output
Write-Output 42
sortie 42

lignee du langage

arbre de PowerShell

vois d ou vient PowerShell, quels langages sont proches, et quoi apprendre ensuite.

racines
shell.NETC#
actuelPowerShellfamille automatisation et commandes
famillefamille automatisation et commandes
utile pour

utile pour parcours pratique pour apprendre PowerShell depuis zero

parcours debutant

1lire une regle2prevoir la sortie3taper de memoire4lancer la verification5recommencer avec un changement

Banque de questions

Chercher puis pratiquer

Choisis une etape ou cherche dans la banque de ce langage puis ouvre l exercice.

18 resultats
Q 1ChoixEtape 1 definitions

PowerShell question 1

PowerShell question 1. Choisis l explication qui correspond le mieux a afficher une valeur.

Q 2ChoixEtape 1 definitions

PowerShell question 2

PowerShell question 2. Choisis l explication qui correspond le mieux a nommer une valeur.

Q 3ChoixEtape 1 definitions

PowerShell question 3

PowerShell question 3. Choisis l explication qui correspond le mieux a fonction reutilisable.

Q 4ChoixEtape 1 definitions

PowerShell question 4

PowerShell question 4. Choisis l explication qui correspond le mieux a collection de base.

Q 5ChoixEtape 1 definitions

PowerShell question 5

PowerShell question 5. Choisis l explication qui correspond le mieux a afficher une valeur.

Q 6ChoixEtape 1 definitions

PowerShell question 6

PowerShell question 6. Choisis l explication qui correspond le mieux a nommer une valeur.

Q 7ChoixEtape 1 definitions

PowerShell question 7

PowerShell question 7. Choisis l explication qui correspond le mieux a fonction reutilisable.

Q 8ChoixEtape 1 definitions

PowerShell question 8

PowerShell question 8. Choisis l explication qui correspond le mieux a collection de base.

Q 9ChoixEtape 1 definitions

PowerShell question 9

PowerShell question 9. Choisis l explication qui correspond le mieux a afficher une valeur.

Q 10ChoixEtape 1 definitions

PowerShell question 10

PowerShell question 10. Choisis l explication qui correspond le mieux a nommer une valeur.

Q 11ChoixEtape 1 definitions

PowerShell question 11

PowerShell question 11. Choisis l explication qui correspond le mieux a fonction reutilisable.

Q 12ChoixEtape 1 definitions

PowerShell question 12

PowerShell question 12. Choisis l explication qui correspond le mieux a collection de base.

Q 13ChoixEtape 1 definitions

PowerShell question 13

PowerShell question 13. Choisis l explication qui correspond le mieux a afficher une valeur.

Q 14ChoixEtape 1 definitions

PowerShell question 14

PowerShell question 14. Choisis l explication qui correspond le mieux a nommer une valeur.

Q 15ChoixEtape 1 definitions

PowerShell question 15

PowerShell question 15. Choisis l explication qui correspond le mieux a fonction reutilisable.

Q 16ChoixEtape 1 definitions

PowerShell question 16

PowerShell question 16. Choisis l explication qui correspond le mieux a collection de base.

Q 17ChoixEtape 1 definitions

PowerShell question 17

PowerShell question 17. Choisis l explication qui correspond le mieux a afficher une valeur.

Q 18ChoixEtape 1 definitions

PowerShell question 18

PowerShell question 18. Choisis l explication qui correspond le mieux a nommer une valeur.

choix multiple

PowerShell question 1

Q 1Choixnouveau

PowerShell question 1. Choisis l explication qui correspond le mieux a afficher une valeur.

Write-Output 42

reference

modeles pour script.ps1

PowerShell 7pwsh script.ps1
rappel de memoirelis un point puis recris le sans regarder
suivre le codenote les valeurs ligne par ligne avant d executer
taper soi memecopie moins tape plus et corrige un petit bug

entry point output syntax Write-Output

sortie du programme

Write-Output 42
  • Run the smallest file first
  • Print one known value
  • Check the output before adding more code

variables assignment types $

valeurs et noms

$total = 42
Write-Output $total
  • Give values readable names
  • Keep one idea per line while learning
  • Trace the value before changing it

function collection Array

fonctions et collections

function Add($a, $b) {
  return $a + $b
}

$scores = @(40, 2)
Write-Output $scores.Count
  • Keep functions small
  • Return useful values
  • Use the common collection before reaching for frameworks