google-cloud-powershell
google-cloud-powershell copied to clipboard
Error when running AppendPsModulePath.ps1 on Windows Server 2012 R2
When running AppendPsModulePath.ps1 in Windows Server 2012 R2 (the version available on GCE) I get the following error:
Get-ItemPropertyValue : The term 'Get-ItemPropertyValue' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At C:\Program Files (x86)\Google\Cloud
SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.0.3\AppendPsModulePath.ps1:15 char:24
+ $installPath = Get-ItemPropertyValue $hklmPath InstallLocation
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-ItemPropertyValue:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
C:\Program Files (x86)\Google\Cloud
SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.0.3\AppendPsModulePath.ps1 : Can not find Google PowerShell.
False\google-cloud-sdk\platform\PowerShell does not exist.
At line:1 char:1
+ .\AppendPsModulePath.ps1 | clip
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,AppendPsModulePath.ps1
It seems that the Get-ItemPropertyValue cmdlet is not available in the version of PowerShell that comes installed with Windows Server 2012 R2. The version is:
PS C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.0.3> $PSVersionTable.PSV
ersion
Major Minor Build Revision
----- ----- ----- --------
4 0 -1 -1
The cmdlet Get-ItemPropertyValue seems like it is only available in PowerShell 5.1 or newer.
Getting the same situation here. I cant manage to load the cmdlets into powershell Any suggestion perhaps?