1

When I run GCloud comannds via windows cmd prompt it works.

But when I run them via powershell it throws an error in red, but the command gets completed successfully.

Eg:

1) Auth

gcloud auth activate-service-account xxx@xxx-xxx.iam.gserviceaccount.com --key-file=C:\xxxxx\cred.json 

Error:

python.exe : Activated service account credentials for: [xxxx@xxxx.iam.gserviceaccount.com]
At xxxxxxxxxxxx\gcloud.ps1:117 char:3
+   & "$cloudsdk_python" $run_args_array
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Activated servi...iceaccount.com]:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

2) Upload file to storage bucket

gsutil cp $outputFile gs://bucketxxx

Error:

gsutil : Copying file://N:\out\sqlserver\tag.csv [Content-Type=application/vnd.ms-excel]...
At xxxxxxx\RDS_SQLServer_ExportData_DataWarehouse.ps1:38 char:5
+     gsutil cp $outputFile gs://bucketxxx  | out-null
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Copying file://...nd.ms-excel]...:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
/ [0 files][    0.0 B/  2.8 MiB]                                                
/ [1 files][  2.8 MiB/  2.8 MiB]                                                
Operation completed over 1 objects/2.8 MiB. 

Nigel Fds
  • 803
  • 2
  • 12
  • 29

1 Answers1

1

I was not able comment, hence adding my inputs here.

First : The issue only seems to occur when this is run via Powershell ISE and not when executed via powershell prompt.

Second : This is not as such an error, for example when you see your own error you find the text after Not Specified as "Activated servi..." which means the action is sucessfully performed. Hope this helps to someone else stumbeling over here

python.exe : Activated service account credentials for: [xxxx@xxxx.iam.gserviceaccount.com]
At xxxxxxxxxxxx\gcloud.ps1:117 char:3
+   & "$cloudsdk_python" $run_args_array
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Activated servi...iceaccount.com]:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
ibrez
  • 146
  • 6