title: Powershell Workflow DynamicActivity Compiler Error '.' Expected Using $Date Variable
body: <p>Usually powershell errors give me something to go on, but this one has thrown me through a loop.  To test, execute the following code:</p>
  
  <pre><code>workflow test-date{
      $Date = Get-Date -format yyyyMMddHHmm -Verbose
  
      Write-Output $Date
  }
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>The workflow 'test-date' could not be started: The following errors were encountered while processing the workflow tree:
  'DynamicActivity': The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "Date".
  '.' expected.
  At line:383 char:21
  +                     throw (New-Object System.Management.Automation.ErrorRecord $ ...
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidArgument: (System.Manageme...etersDictionary:PSBoundParametersDictionary) [], RuntimeException
      + FullyQualifiedErrorId : StartWorkflow.InvalidArgument
  </code></pre>
  
  <p>The part that really get's me is that it says it's expecting a "." somewhere.  I don't know where it's expecting to find a '.'.  I've googled the error which didn't produce anything relevant to my situation.  I'd like to know more about what this error means, and why I'm getting it.  It'd be nice if someone knows the solution too.</p>