===
Normal cmdlet
===

Write-Host "CERT"

---

(program
  (statement_list
    (pipeline
      (pipeline_chain
        (command
          (command_name)
          (command_elements
            (command_argument_sep)
            (array_literal_expression
              (unary_expression
                (string_literal
                  (expandable_string_literal))))))))))

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

555Write-Host 4+7+8

---

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

===
Cmdlet with mixed string
===

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

---

(program
  (statement_list
    (pipeline
      (pipeline_chain
        (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
      (pipeline_chain
        (command
          command_name: (command_name)
          command_elements: (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)
            (array_literal_expression
              (unary_expression
                (sub_expression
                  statements: (statement_list
                    (pipeline
                      (pipeline_chain
                        (logical_expression
                          (bitwise_expression
                            (comparison_expression
                              (comparison_expression
                                (additive_expression
                                  (multiplicative_expression
                                    (format_expression
                                      (range_expression
                                        (array_literal_expression
                                          (unary_expression
                                            (parenthesized_expression
                                              (pipeline
                                                (pipeline_chain
                                                  (logical_expression
                                                    (bitwise_expression
                                                      (comparison_expression
                                                        (additive_expression
                                                          (multiplicative_expression
                                                            (format_expression
                                                              (range_expression
                                                                (array_literal_expression
                                                                  (unary_expression
                                                                    (member_access
                                                                      (parenthesized_expression
                                                                        (pipeline
                                                                          (pipeline_chain
                                                                            (command
                                                                              command_name: (command_name)
                                                                              command_elements: (command_elements
                                                                                (command_argument_sep)
                                                                                (generic_token))))))
                                                                      (member_name
                                                                        (simple_name))))))))))))))))))))))
                              (comparison_operator)
                              (additive_expression
                                (multiplicative_expression
                                  (format_expression
                                    (range_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)
            (array_literal_expression
              (unary_expression
                (variable)))))))))


===
Quoted CmdLet
===

i''ex "pwd"

---

(program
  (statement_list
    (pipeline
      (pipeline_chain
        (command
          (command_name)
          (command_elements
            (command_argument_sep)
            (array_literal_expression
              (unary_expression
                (string_literal
                  (expandable_string_literal))))))))))

===
Double Quoted CmdLet
===

i""ex "pwd"

---

(program
  (statement_list
    (pipeline
      (pipeline_chain
        (command
          (command_name)
          (command_elements
            (command_argument_sep)
            (array_literal_expression
              (unary_expression
                (string_literal
                  (expandable_string_literal))))))))))

===
Obfuscated cmdlet and string
===

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

---

(program
  (statement_list
    (pipeline
      (pipeline_chain
        (command
          (command_name)
          (command_elements
            (command_argument_sep)
            (array_literal_expression
              (unary_expression
                (string_literal
                  (expandable_string_literal))))))))))

===
Native command
===

net.exe

---

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


===
Unix-like native command
===

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

---

(program
  (statement_list
    (pipeline
      (pipeline_chain
        (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
      (pipeline_chain
        (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
      (pipeline_chain
        (command
          (command_name)
          (command_elements
            (script_block_expression
              (script_block
                (script_block_body
                  (statement_list
                    (pipeline
                      (pipeline_chain
                        (logical_expression
                          (bitwise_expression
                            (comparison_expression
                              (additive_expression
                                (multiplicative_expression
                                  (format_expression
                                    (range_expression
                                      (array_literal_expression
                                        (unary_expression
                                          (parenthesized_expression
                                            (pipeline
                                              (pipeline_chain
                                                (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
      (pipeline_chain
        (command
          (command_name)
          (command_elements
            (command_argument_sep)
            (array_literal_expression
              (unary_expression
                (string_literal
                  (expandable_string_literal))))))))))

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

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

---

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

===
Diff between argument and array literal
===

$rih2ymeurlleflu = & "New-Object" "System.Net.Sockets.TCPClient"("127.0.0.1", 4444)

---

(program
  (statement_list
    (pipeline
      (assignment_expression
        (left_assignment_expression
          (logical_expression
            (bitwise_expression
              (comparison_expression
                (additive_expression
                  (multiplicative_expression
                    (format_expression
                      (range_expression
                        (array_literal_expression
                          (unary_expression
                            (variable)))))))))))
        (assignement_operator)
        value: (pipeline
          (pipeline_chain
            (command
              (command_invokation_operator)
              command_name: (command_name_expr
                (string_literal
                  (expandable_string_literal)))
              command_elements: (command_elements
                (command_argument_sep)
                (array_literal_expression
                  (unary_expression
                    (string_literal
                      (expandable_string_literal))))
                (argument_list
                  argument_expression_list: (argument_expression_list
                    (argument_expression
                      (logical_argument_expression
                        (bitwise_argument_expression
                          (comparison_argument_expression
                            (additive_argument_expression
                              (multiplicative_argument_expression
                                (format_argument_expression
                                  (range_argument_expression
                                    (unary_expression
                                      (string_literal
                                        (expandable_string_literal)))))))))))
                    (argument_expression
                      (logical_argument_expression
                        (bitwise_argument_expression
                          (comparison_argument_expression
                            (additive_argument_expression
                              (multiplicative_argument_expression
                                (format_argument_expression
                                  (range_argument_expression
                                    (unary_expression
                                      (integer_literal
                                        (decimal_integer_literal)))))))))))))))))))))

===
Cmdlet that start with a keyword
===

download toto

---

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


===
Cmdlet with parenthesized_expression as parameter without any white space
===

iex("calc.exe")

---

(program
  (statement_list
    (pipeline
      (pipeline_chain
        (command
          command_name: (command_name)
          command_elements: (command_elements
            (parenthesized_expression
              (pipeline
                (pipeline_chain
                  (logical_expression
                    (bitwise_expression
                      (comparison_expression
                        (additive_expression
                          (multiplicative_expression
                            (format_expression
                              (range_expression
                                (array_literal_expression
                                  (unary_expression
                                    (string_literal
                                      (expandable_string_literal))))))))))))))))))))

===
Cmdlet that start with a keyword 2
===

Exit-test toto

---

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