===
Normal cmdlet
===

Write-Host "CERT"

---

(program
  (statement_list
    (pipeline
      (command
        (command_name)
        (command_elements
          (command_argument_sep)
          (string_literal
            (expandable_string_literal)))))))

===
Cmdlet that start with a number
===

555Write-Host 4+7+8

---

(program
  (statement_list
    (pipeline
      (command
        (command_name)
        (command_elements
          (command_argument_sep)
          (generic_token))))))

===
Cmdlet with mixed string
===

555Write-"${message}" 4+7+8

---

(program
  (statement_list
    (pipeline
      (command
        (command_name
          (variable
            (braced_variable)))
        (command_elements
          (command_argument_sep)
          (generic_token))))))

===
Plain cmdlet
===

New-DynamicParam -Name Plugins -type string[] -ValidateSet $(((gci .\plugins\*.pl).name) -replace "\.pl","") -DPDictionary $Dictionary

---

(program
  (statement_list
    (pipeline
      (command
        (command_name)
        (command_elements
          (command_argument_sep)
          (command_parameter)
          (command_argument_sep)
          (generic_token)
          (command_argument_sep)
          (command_parameter)
          (command_argument_sep)
          (generic_token)
          (command_argument_sep)
          (command_parameter)
          (command_argument_sep)
          (sub_expression
            (statement_list
              (pipeline
                (logical_expression
                  (bitwise_expression
                    (comparison_expression
                      (comparison_expression
                        (additive_expression
                          (multiplicative_expression
                            (format_expression
                              (range_expression
                                (array_literal_expression
                                  (unary_expression
                                    (parenthesized_expression
                                      (pipeline
                                        (logical_expression
                                          (bitwise_expression
                                            (comparison_expression
                                              (additive_expression
                                                (multiplicative_expression
                                                  (format_expression
                                                    (range_expression
                                                      (array_literal_expression
                                                        (unary_expression
                                                          (member_access
                                                            (parenthesized_expression
                                                              (pipeline
                                                                (command
                                                                  (command_name)
                                                                  (command_elements
                                                                    (command_argument_sep)
                                                                    (generic_token)))))
                                                            (member_name
                                                              (simple_name)))))))))))))))))))))
                      (comparison_operator)
                      (additive_expression
                        (multiplicative_expression
                          (format_expression
                            (range_expression
                              (array_literal_expression
                                (array_literal_expression
                                  (unary_expression
                                    (string_literal
                                      (expandable_string_literal))))
                                (unary_expression
                                  (string_literal
                                    (expandable_string_literal))))))))))))))
          (command_argument_sep)
          (command_parameter)
          (command_argument_sep)
          (variable))))))


===
Quoted CmdLet
===

i''ex "pwd"

---

(program
  (statement_list
    (pipeline
      (command
        (command_name)
        (command_elements
          (command_argument_sep)
          (string_literal
            (expandable_string_literal)))))))

===
Double Quoted CmdLet
===

i""ex "pwd"

---

(program
  (statement_list
    (pipeline
      (command
        (command_name)
        (command_elements
          (command_argument_sep)
          (string_literal
            (expandable_string_literal)))))))

===
Obfuscated cmdlet and string
===

ie""x'' "p`"`"w''d`"`""

---

(program
  (statement_list
    (pipeline
      (command
        (command_name)
        (command_elements
          (command_argument_sep)
          (string_literal
            (expandable_string_literal)))))))

===
Native command
===

net.exe

---

(program
  (statement_list
    (pipeline
      (command
        (command_name)))))


===
Unix-like native command
===

git clone -b this_branch --single-branch https://github.com/PowerShell/PowerShell

---

(program
  (statement_list
    (pipeline
      (command
        (command_name)
        (command_elements
          (command_argument_sep)
          (generic_token)
          (command_argument_sep)
          (command_parameter)
          (command_argument_sep)
          (generic_token)
          (command_argument_sep)
          (command_parameter)
          (command_argument_sep)
          (generic_token))))))

===
Windows-style native command
===

net use e: \\usrsvr002\smithmark Ue345Ii /user:pdc01\msmith2 /savecred /p:yes

---

(program
  (statement_list
    (pipeline
      (command
        (command_name)
        (command_elements
          (command_argument_sep)
          (generic_token)
          (command_argument_sep)
          (generic_token)
          (command_argument_sep)
          (generic_token)
          (command_argument_sep)
          (generic_token)
          (command_argument_sep)
          (generic_token)
          (command_argument_sep)
          (generic_token)
          (command_argument_sep)
          (generic_token))))))


===
Foreach statement without token separator
===

%{ ( [char][int] $_)}

---

(program
  (statement_list
    (pipeline
      (command
        (foreach_command
          (script_block_expression
            (script_block
              (script_block_body
                (statement_list
                  (pipeline
                    (logical_expression
                      (bitwise_expression
                        (comparison_expression
                          (additive_expression
                            (multiplicative_expression
                              (format_expression
                                (range_expression
                                  (array_literal_expression
                                    (unary_expression
                                      (parenthesized_expression
                                        (pipeline
                                          (logical_expression
                                            (bitwise_expression
                                              (comparison_expression
                                                (additive_expression
                                                  (multiplicative_expression
                                                    (format_expression
                                                      (range_expression
                                                        (array_literal_expression
                                                          (unary_expression
                                                            (expression_with_unary_operator
                                                              (cast_expression
                                                                (type_literal
                                                                  (type_spec
                                                                    (type_name
                                                                      (type_identifier))))
                                                                (unary_expression
                                                                  (expression_with_unary_operator
                                                                    (cast_expression
                                                                      (type_literal
                                                                        (type_spec
                                                                          (type_name
                                                                            (type_identifier))))
                                                                      (unary_expression
                                                                        (variable)))))))))))))))))))))))))))))))))))))

===
multiline command line
===

Write-Debug `
	"debug"

---

(program
  (statement_list
    (pipeline
      (command
        (command_name)
        (command_elements
          (command_argument_sep)
          (generic_token))))))

===
command with argument set by :
===

New-Item $profileDir -ItemType Directory -Force -Verbose:$VerbosePreference > $null

---

(program
  (statement_list
    (pipeline
      (command
        (command_name)
        (command_elements
          (command_argument_sep)
          (variable)
          (command_argument_sep)
          (command_parameter)
          (command_argument_sep)
          (generic_token)
          (command_argument_sep)
          (command_parameter)
          (command_argument_sep)
          (command_parameter)
          (command_argument_sep)
          (variable)
          (command_argument_sep)
          (redirection
            (file_redirection_operator)
            (redirected_file_name
              (command_argument_sep)))
          (variable))))))