openalm / Extension-UtilitiesPack

Release Management utility tasks
Other
34 stars 38 forks source link

TFS vNext Powershell build step is using older version of Powershell module #41

Closed kfrajtak closed 8 years ago

kfrajtak commented 8 years ago

Hi,

a build with Powershell++ step keeps failing when I try to run task containing following code Copy-Item -FromSession $cs (the command is not complete, important is the usage of FromSession) to copy items from a different machine. The error message is

A parameter cannot be found that matches parameter name 'FromSession'.

However, the code does not fail when run from PS console when I'm logged to that machine.

Then I included

(get-command copy-item).Version.ToString()
(get-command copy-item).ModuleName.ToString()

And got version 3.1.0.0 and module Microsoft.PowerShell.Management in PS console and 3.0.0.0 in TFS build step output (module is the same). The version of Powershell is identical in both - 5.0.10586.117.

Looks like the Powershell that is running inside TFS is using different modules.

Is there a task requierement to use specific version of Powershell modules? Or is TFS using Powershell with different set of modules?

Thanks for help, Karel

kfrajtak commented 8 years ago

Sorry, this is neither related to utilities pack nor to Microsoft.PowerShell.Management version. The issue here is the source path and the provider - when wildcard character is used, I get this error. It works fine without wildcards.