une suite d instructions executees dans un ordre clair.
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.
script.ps1executer pwsh script.ps1habitude apprends une petite piece de PowerShell, tape un exemple minimal et execute-leune valeur est une donnee. Une variable est le nom qui la garde.
un petit travail nomme qui recoit une entree et produit un resultat.
PowerShell 7 execute le code de script.ps1.
premier code lisible
sortie du programme
entry point output syntax Write-OutputWrite-Output 42
sortie 42lignee du langage
arbre de PowerShell
vois d ou vient PowerShell, quels langages sont proches, et quoi apprendre ensuite.
parcours debutant
Banque de questions
Chercher puis pratiquer
Choisis une etape ou cherche dans la banque de ce langage puis ouvre l exercice.
PowerShell question 1
PowerShell question 1. Choisis l explication qui correspond le mieux a afficher une valeur.
PowerShell question 2
PowerShell question 2. Choisis l explication qui correspond le mieux a nommer une valeur.
PowerShell question 3
PowerShell question 3. Choisis l explication qui correspond le mieux a fonction reutilisable.
PowerShell question 4
PowerShell question 4. Choisis l explication qui correspond le mieux a collection de base.
PowerShell question 5
PowerShell question 5. Choisis l explication qui correspond le mieux a afficher une valeur.
PowerShell question 6
PowerShell question 6. Choisis l explication qui correspond le mieux a nommer une valeur.
PowerShell question 7
PowerShell question 7. Choisis l explication qui correspond le mieux a fonction reutilisable.
PowerShell question 8
PowerShell question 8. Choisis l explication qui correspond le mieux a collection de base.
PowerShell question 9
PowerShell question 9. Choisis l explication qui correspond le mieux a afficher une valeur.
PowerShell question 10
PowerShell question 10. Choisis l explication qui correspond le mieux a nommer une valeur.
PowerShell question 11
PowerShell question 11. Choisis l explication qui correspond le mieux a fonction reutilisable.
PowerShell question 12
PowerShell question 12. Choisis l explication qui correspond le mieux a collection de base.
PowerShell question 13
PowerShell question 13. Choisis l explication qui correspond le mieux a afficher une valeur.
PowerShell question 14
PowerShell question 14. Choisis l explication qui correspond le mieux a nommer une valeur.
PowerShell question 15
PowerShell question 15. Choisis l explication qui correspond le mieux a fonction reutilisable.
PowerShell question 16
PowerShell question 16. Choisis l explication qui correspond le mieux a collection de base.
PowerShell question 17
PowerShell question 17. Choisis l explication qui correspond le mieux a afficher une valeur.
PowerShell question 18
PowerShell question 18. Choisis l explication qui correspond le mieux a nommer une valeur.
choix multiple
PowerShell question 1
PowerShell question 1. Choisis l explication qui correspond le mieux a afficher une valeur.
Write-Output 42
reference
modeles pour script.ps1
pwsh script.ps1entry 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