错误:[System.Management.Automation.PSObject]不包含名为'op_Addition的方法

时间:2019-02-16 12:14:12

标签: powershell vmware powercli

嗨,我正在尝试运行脚本以从所有数据存储中获取信息。

我正在运行的代码脚本出现错误:

        if let _ = someThing {
            let spacing: CGFloat = 30.0
            if viewController.parent == nil {
                return
            }
            if #available(iOS 11.0, *) {
                viewController.additionalSafeAreaInsets.top = spacing
            }
            else {
                NSLayoutConstraint.activate([
                    viewController.view.topAnchor.constraint(equalTo: viewController.topLayoutGuide.bottomAnchor , constant: spacing),
                    viewController.bottomLayoutGuide.bottomAnchor.constraint(equalTo:viewController.view.bottomAnchor, constant: 0)
                    ])
            }
        }
        else {
            if #available(iOS 11.0, *) {
                viewController.additionalSafeAreaInsets.top = 0
            }
            else {

                    NSLayoutConstraint.activate([
                        viewController.view.topAnchor.constraint(equalTo: viewController.topLayoutGuide.bottomAnchor, constant: 0)
                        ])
            }
        }

该脚本是一个简单的for循环:

At C:\Users\Administrator\Desktop\Scripts\test.ps1:125 char:2
+     $allstoreinfo += $storeinfo
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (op_Addition:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

0 个答案:

没有答案