下面粘贴的是我的示例 JSON 文件。
我正在尝试这样做
foreach ($p in $apijson.paths.PSObject.Properties.Value) {
$get = $p.get.'x-qlik-visibility' -eq 'Private'
if ($get -eq 'True') {
Write-Host 'Removing Object :'$p
# Remove-ItemProperty -Name $p.get
$apijsonNew.PSObject.Properties.Remove($p)
}
}
Run Code Online (Sandbox Code Playgroud)
{
"swagger": "2.0",
"info": {
"title": "Open API specification for Repository Main API",
"version": "20.8.0"
},
"basePath": "/qrs",
"schemes": [
"https"
],
"paths": {
"/about/api/default/analyticconnection": {
"get": {
"operationId": "2b781738-afd0-37a9-4248-84ec8d6be58c",
"parameters": [
{
"name": "listentries",
"in": "query",
"required": false,
"default": true,
"type": "boolean", …Run Code Online (Sandbox Code Playgroud)