google-cloud-powershell icon indicating copy to clipboard operation
google-cloud-powershell copied to clipboard

Uninstalled SDK; reinstalled SDK; no more powershell commands.

Open SurferJeffAtGoogle opened this issue 8 years ago • 2 comments

PS C:\Users\root> gcloud components install powershell

All components are up to date.
PS C:\Users\root> ls $env:LOCALAPPDATA\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.0.0\
ls : Cannot find path 'C:\Users\root\AppData\Local\Google\Cloud' because it does not exist.
At line:1 char:1
+ ls $env:LOCALAPPDATA\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\Googl ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\root\AppData\Local\Google\Cloud:String) [Get-ChildItem], ItemN
   otFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

PS C:\Users\root> ls "$env:LOCALAPPDATA\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.0.0\"
ls : Cannot find path 'C:\Users\root\AppData\Local\Google\Cloud
SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.0.0\' because it does not exist.
At line:1 char:1
+ ls "$env:LOCALAPPDATA\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\Goog ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\root\A...eCloud\1.0.0.0\:String) [Get-ChildItem], ItemNotFound
   Exception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

PS C:\Users\root> ls "$env:LOCALAPPDATA\Google\Cloud SDK"


    Directory: C:\Users\root\AppData\Local\Google\Cloud SDK


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         2/23/2017  11:19 PM            google-cloud-sdk
-a---         2/23/2017  11:19 PM        261 cloud_env.bat
-a---        12/19/2016   9:59 PM     121715 cloud_platform_logo.ico
-a---         2/23/2017  11:19 PM          1 install_mode
-a---         2/23/2017  11:19 PM     184130 uninstaller.exe


PS C:\Users\root> ls "C:\Users\root\AppData\Local\Google\Cloud SDK\google-cloud-sdk"


    Directory: C:\Users\root\AppData\Local\Google\Cloud SDK\google-cloud-sdk


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         2/23/2017  11:19 PM            .install
d----         2/23/2017  11:19 PM            bin
d----         2/23/2017  11:19 PM            lib
d----         2/23/2017  11:19 PM            platform
-a---         2/23/2017  11:18 PM       2555 completion.bash.inc
-a---         2/23/2017  11:18 PM       1988 completion.zsh.inc
-a---         2/23/2017  11:18 PM       1581 install.bat
-a---         2/23/2017  11:18 PM       3509 install.sh
-a---         2/23/2017  11:18 PM        980 LICENSE
-a---         2/23/2017  11:18 PM        308 path.bash.inc
-a---         2/23/2017  11:18 PM         31 path.zsh.inc
-a---         2/23/2017  11:19 PM         43 properties
-a---         2/23/2017  11:18 PM        673 README
-a---         2/23/2017  11:18 PM     129719 RELEASE_NOTES
-a---         2/23/2017  11:18 PM          8 VERSION


PS C:\Users\root> ls "C:\Users\root\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform"


    Directory: C:\Users\root\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         2/23/2017  11:19 PM            bq
d----         2/23/2017  11:19 PM            bundledpython
d----         2/23/2017  11:19 PM            ext-runtime
d----         2/23/2017  11:19 PM            GoogleCloudPowerShell
d----         2/23/2017  11:19 PM            gsutil
d----         2/23/2017  11:19 PM            PowerShell


PS C:\Users\root> ls "C:\Users\root\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud"


    Directory: C:\Users\root\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         2/23/2017  11:19 PM            1.0.0.3


PS C:\Users\root> ls "C:\Users\root\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.
0.3\AppendPsModulePath.ps1"


    Directory: C:\Users\root\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.0.3


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---         1/31/2017   7:27 PM       3112 AppendPsModulePath.ps1


PS C:\Users\root> "C:\Users\root\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.0.3
\AppendPsModulePath.ps1"
C:\Users\root\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.0.3\AppendPsModulePat
h.ps1
PS C:\Users\root> get-command | where {$_.ModuleName -like "*Google*"}
PS C:\Users\root>

SurferJeffAtGoogle avatar Feb 23 '17 23:02 SurferJeffAtGoogle

@SurferJeffAtGoogle, can you try & "C:\Users\root\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.0.3 \AppendPsModulePath.ps1"? I think you miss out the &

quoctruong avatar Feb 23 '17 23:02 quoctruong

How did you reinstall the SDK? Did you use the Windows installer?

It appears that everything is working as expected. The PowerShell bits are on your machine in the ...\Cloud SDK\google-cloud-sdk\platform\PowerShell\GoogleCloud\1.0.0.3 folder.

However, you won't "see" any of the PowerShell cmdlets unless the module is on you PSModulePath environment variable. (That is what AppendPsModulePath.ps1 does.)

When you install PowerShell cmdlets from the Windows installer, we update your environment variable so things "just work". However, if you installed from the command line or unzipping an archive, your module path is not updated. (Which is probably a bug or something we should look into fixing.)

chrsmith avatar Feb 25 '17 00:02 chrsmith