powershell - Powershell将Json字符串传递给外部函数
问题描述
我正在尝试将一个传递JSON String
给外部函数。但是,似乎无法将此视为有效论点。
以下作品完美找到的是Shell Script
old_config=`databricks clusters get --cluster-id $cluster_id`
databricks clusters edit --json "${old_config}"
但是,PowerShell中的以下抛出和错误
$OldConfig=databricks clusters get --cluster-id $ClusterID
databricks clusters edit --json "${OldConfig}"
错误
PS Azure:\> databricks clusters edit --json "$OldConfig" --debug
HTTP debugging enabled
Usage: databricks clusters edit [OPTIONS]
Try "databricks clusters edit -h" for help.
Error: Got unexpected extra arguments (cluster terminated (inactive for 15 minutes)., autotermination_minutes: 15, terminated_time: 1575562085278, spark_conf: {spark.databricks.cluster.profile: serverless, spark.databricks.io.cache.enabled: false, spark.databricks.repl.allowedLanguages: sql,python,r, spark.databricks.io.cache.maxMetaDataCache: 0, spark.databricks.delta.preview.enabled: true, spark.driver.maxResultSize: 7GB }, driver_node_type_id: Standard_DS4_v2, last_state_loss_time: 1575561173235, start_time: 1566998040228, termination_reason: { code: INACTIVITY, parameters: { inactivity_duration_min: 15 } },custom_tags: { cluster_name: GatewayCluster, ResourceClass: Serverless, cluster_id: 0828-11122-ddi3i3 }, cluster_name: GatewayCluster, init_scripts_safe_mode: false, state: TERMINATED, spark_version: 5.5.x-scala2.11, cluster_id: 0828-131400-dents910, creator_user_name: abc@xyz.com, default_tags: { ClusterName: GatewayCluster, ClusterId: 0828-11122-ddi3i3, Vendor: Databricks, Creator: abc@xyx.com }, cluster_source: UI, autoscale: { max_workers: 20, min_workers: 7 }, spark_context_id: 11299222 })
(.venv) Azure:/
解决方案
推荐阅读
- string - AttributeError:“str”对象没有属性“from_header”
- json - 在模型上调用保存时 Ember Octane 的默认接受和内容类型标头是什么?
- kotlin - 如何制作 Kryo 串行器
- django - 从 REST_API 响应重定向
- python - 安装npm包时如何解决python错误?
- amazon-web-services - 将 Docker-Compose YML 部署到 AWS ECS
- javascript - 用相同的值更新数组中的所有元素
- javascript - Google Analytics 中的数据差异和 Google 电子表格中的 API 结果
- c# - 我收到此错误,如果可能,需要帮助修复它。我正在尝试构建我的项目以查看输出,但它不会让我
- c# - 如何检查用户是否在 C# 中打开了浏览器