我有下面的代码,用于通过 terraform 在 aws 中创建 s3 存储桶和云前端,但 terraform 给出错误。\n我正在使用适用于 Windows 的最新版本的 terraform cli exe。\n Main.tf \n请找到下面的 main.tf 代码。 tf 文件:
\nterraform {\n required_providers {\n aws = {\n source = "hashicorp/aws"\n version = "3.70.0"\n }\n }\n}\n\nprovider "aws" {\n access_key = "${var.aws_access_key}"\n secret_key = "${var.aws_secret_key}"\n region = "${var.aws_region}"\n}\n\nresource "aws_s3_bucket" "mybucket" {\n bucket = "${var.bucket_name}"\n acl = "public-read"\n\n website {\n redirect_all_requests_to = "index.html"\n }\n\n cors_rule {\n allowed_headers = ["*"]\n allowed_methods = ["PUT","POST"]\n allowed_origins = ["*"]\n expose_headers = ["ETag"]\n max_age_seconds = 3000\n }\n\n …Run Code Online (Sandbox Code Playgroud) 如何避免删除只读,我需要正常的Excel而不是只读。我有以下代码:
$excelfile="C:\Users\Administrator\Pictures\unprotect_org - Copy\unprotect - Copy (2).xlsx"
$excel = New-Object -ComObject Excel.Application
$excel.Visible = $false
$excel.DisplayAlerts = $false
$wb = $excel.Workbooks.Open($excelfile,$true,123)
$wb.SaveAs($excelfile,[Type]::Missing,$password)
$excel.Quit()
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Cannot save as that name. Document was opened as read-only.
At line:1 char:1
+ $wb.SaveAs($excelfile,[Type]::Missing,$password)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
Run Code Online (Sandbox Code Playgroud)
第二件事,为什么 microsoft execel 在任务管理器中打开,我怎样才能关闭这个 exe。

请帮我解决这个错误。