Error on Octopus 2.4.7 deploy to windows 2008 server

Hi
I am having an issue with one of my nodes while trying to deploy projects to it. The deploy.ps1 is failing on the following.

Add-Type : The term 'Add-Type' is not recognized as the name of a cmdlet,
Error 13:17:51
function, script file, or operable program. Check the spelling of the name, or
Error 13:17:51
if a path was included, verify that the path is correct and try again.
Error 13:17:51
At E:\inetpub\wwwroot\DEV\RetirementProductsPlatform\1.0.292_2\Bootstrap.8c24d3
Error 13:17:51
9f-c038-4af5-9341-9c160e794c7b.ps1:2 char:1
Error 13:17:51
+ Add-Type -AssemblyName System.Security
Error 13:17:51
+ ~~~~~~~~
Error 13:17:51
+ CategoryInfo : ObjectNotFound: (Add-Type:String) [], CommandNot
Error 13:17:51
FoundException
Error 13:17:51
+ FullyQualifiedErrorId : CommandNotFoundException
Error 13:17:51
test-path : The term 'test-path' is not recognized as the name of a cmdlet,
Error 13:17:51
function, script file, or operable program. Check the spelling of the name, or
Error 13:17:51
if a path was included, verify that the path is correct and try again.
Error 13:17:51
At E:\inetpub\wwwroot\DEV\RetirementProductsPlatform\1.0.292_2\Bootstrap.8c24d3
Error 13:17:51
9f-c038-4af5-9341-9c160e794c7b.ps1:4 char:11
Error 13:17:51
+ if (-Not (test-path variable:global:OctopusDeploymentId)) {
Error 13:17:51
+ ~~~~~~~~~

The 2.7 tentacle version is running on a windows 2008 server which also has dotnet 4.5 and Powershell 3. I have went so far as to remove the tentacle and reinstall powershell 3 then reinstall the tentacle with no luck… Any thoughts would be greatly apprciated…

thanks

Hi Jeramie,

Thanks for getting in touch!
The error we are seeing here (as I think you too have figured out) is the wrong version of PowerShell being invoked.
Could you please open a PowerShell command prompt on that server and type in $host and copy and paste the output.
This should help us get to the bottom of this.

Vanessa

Hi Vanessa
Here is the output from my server.

PS C:\Users\JJones> $host

Name : ConsoleHost
Version : 3.0
InstanceId : b747cf40-62ac-43e5-b8ed-14b5a1d9b848
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace

Ill double check my script as well… I believe its using powershell 2. 0 in the deploy script… Which shouldn’t be an issue…

Thanks

Jeramie Jones
Application Team
Ascensus Inc.
815 8th St NE
Brainerd, Mn 56401
Phone: (218) 825-5464
Email: Jeramie.jones@ascensus.com
Visit us on the web at www.ascensus.com
People Matter. Quality First. Integrity Always.SM

Hi Jeramie,

The commands that you are missing come through in the Microsoft.PowerShell.Utility module which should be imported be default.

You can verify that this module has been loaded by running the Get-Module cmdlet. In a fresh session you should see two entries, Microsoft.PowerShell.Utility and Microsoft.PowerShell.Management. I suggest testing this in the Octopus deploy.ps1 script and in the native PowerShell shell. The tentacle will use the 64bit version of PowerShell so the results should be the same in both tests. If the module is missing it may indicate an issue with PowerShell or a Profile on the system.

If the module is missing, as a temporary solution you can import it by running Import-Module Microsoft.PowerShell.Utility. I’d also suggest verifying that the profiles have not been modified.

Daniel