Closed justlearntutors closed 5 years ago
SOLUTION New-GcsObject -Bucket "ssl-images-justlearn" -File "C:\CodeDeployWindowsDemo\EnviromentSetup\publishAppRaw\wwwroot\stylesheet.min.css" -ObjectName "article\stylesheet.min.css"
How do I add cache headers for file?
@justlearntutors, -ObjectNamePrefix
and -ObjectName
are actually 2 different parameters.
The -ObjectNamePrefix
parameter is meant to be used with -Folder
parameter. When used together, -ObjectNamePrefix
is the prefix that will be applied to every object which is uploaded.
-ObjectName
parameter is used for uploading a file.
@justlearntutors, you can use the -Metadata
parameter to add metadata to the object being uploaded. For example: New-GcsObject -Bucket my-bucket "new-object" -Metadata @{"Content-Type" = "image/png"}
.
You can read more about this cmdlet here
I am trying to upload a file.
WORKS New-GcsObject -Bucket "ssl-images-justlearn" -File "C:\CodeDeployWindowsDemo\EnviromentSetup\publishAppRaw\wwwroot\stylesheet.min.css"
ERROR New-GcsObject -Bucket "ssl-images-justlearn" -File "C:\CodeDeployWindowsDemo\EnviromentSetup\publishAppRaw\wwwroot\stylesheet.min.css" -ObjectNamePrefix "article"