The script immediately fails with a tokenization error. Which delimiter should replace the closing "*/" so that the block is parsed as a valid PowerShell comment?
PowerShell supports multi-line (block) comments that begin with the characters "<#" and end with the characters "#>". Any text between those two markers is ignored by the interpreter, regardless of how many lines it spans. Replacing the incorrect "/" terminator with "#>" creates a properly formed <# … #> block comment and allows the script to run. The other delimiters shown are used in other languages ("/" in C-style languages, "//" for single-line comments in C/C++, "--" in SQL) and will still generate a syntax error in PowerShell.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why does PowerShell use `<#` and `#>` for multi-line comments?
Open an interactive chat with Bash
What is the difference between PowerShell single-line and multi-line comments?
Open an interactive chat with Bash
What happens if you use incorrect comment delimiters in PowerShell?