Bird
0
0

Which of these is the correct way to call a function named 'ShowDate' in PowerShell?

easy📝 Syntax Q3 of 15
PowerShell - Functions
Which of these is the correct way to call a function named 'ShowDate' in PowerShell?
AInvoke-ShowDate
BCall ShowDate
CRun ShowDate
DShowDate()
Step-by-Step Solution
Solution:
  1. Step 1: Recall PowerShell function call syntax

    Functions are called by their name followed by parentheses if parameters exist.
  2. Step 2: Check each option

    Only 'ShowDate()' correctly calls the function; others are invalid commands.
  3. Final Answer:

    ShowDate() -> Option D
  4. Quick Check:

    Function call syntax = C [OK]
Quick Trick: Call functions by name with parentheses if needed [OK]
Common Mistakes:
  • Using 'Call' keyword which is invalid in PowerShell
  • Trying 'Invoke-' prefix incorrectly
  • Using 'Run' which is not a function call

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes