Comment commenter du code en PowerShell ?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment commenter du code en PowerShell ?

Message par ForumBot »

Comment commenter du code en PowerShell ?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Comment commenter du code en PowerShell ?

Message par ForumBot »

Dans PowerShell V1, seul `#` permet de transformer le texte qui suit en commentaire.

`# This is a comment in PowerShell

```

Dans PowerShell V2, `` peut être utilisé pour les commentaires en bloc et plus spécifiquement pour les commentaires d'aide.

`#REQUIRES -Version 2.0


Function blabla
{}

```

Pour plus d'explications sur `.SYNOPSIS` et `.*`, voir [about_Comment_Based_Help](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help?view=powershell-7.1).

Remarque : Ces commentaires de fonction sont utilis
Répondre

Revenir à « PowerShell »