title: How to pass powershell variable to groovy variable in Jenkinsfile
body: <p>I am writing pipeline in Jenkinsfile. And I have the problem. How can I pass powershell variable to groovy variable, or how can I manipulate with files within groovy in Jenkinsfile as I do via powershell? </p>
  
  <pre><code>     stage('GETTING SLN FILES') {
         steps {
             script {
                 powershell """$dirs_with_sln = Get-ChildItem -Path . -Recurse *.sln | Select-Object -Property Directory -Unique
                               $slns = @()
                               foreach($dir in $dirs_with_sln) {
                                 $dir = $dir.Directory
                                 $FileExists = Test-Path -Path "$dir\\default.ps1"
                                 if ($FileExists -eq $true) {
                                     $slns += $(Get-ChildItem -Path $dir -Filter *.sln).FullName
                                 }
                               }
                            """
      }
  </code></pre>
  
  <p>My solutions.json file :</p>
  
  <pre><code>[
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\AlertDelivery\\AlertDelivery.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\BusinessWireNewsProcessor\\BusinessWireNewsProcessor.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\ComponentMesosExecutor\\ComponentMesosExecutor.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\Crawling\\Core\\Agent\\CrawlingAgent.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\Crawling\\Crawlers\\Crawlers.Base\\_Crawlers.Base.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\Crawling\\Crawlers\\Crawlers.Custom\\_Crawlers.Custom.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\Crawling\\Crawlers\\Crawlers.Internal\\_Crawlers.Internal.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\Crawling\\Crawlers\\Crawlers.Reporting\\_Crawlers.Reporting.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\DocumentsMerge\\VADocumentsMerge\\VADocumentsMerge.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\Downloading\\DownloadProcessor.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\LogCollector\\LogCollector.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\MailProcessor\\MailProcessor.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\MailProcessor\\ProcessingAlgorithms\\CourthouseNewsAlgorithm\\InfoNgen.MailProcessor.CourthouseNewsAlgorithm.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\MailProcessor\\ProcessingAlgorithms\\DefaultProcessingAlgorithms\\InfoNgen.MailProcessor.DefaultProcessingAlgorithms.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\MailProcessor\\ProcessingAlgorithms\\HtmlNewsletterAlgorithm\\HtmlNewsletterAlgorithm.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\ProcessingUnit\\ProcessingUnit.sln",
      "D:\\ws\\workspace\\msbuild-test\\src\\DataProcessors\\SharePointDataLoader\\SharePointDataLoader.sln"
  ]
  
  
  </code></pre>