【问题标题】:powershell and indexer propertypowershell 和索引器属性
【发布时间】:2010-11-20 23:12:14
【问题描述】:

如果 C# 中的索引器表示为:index[1, 1]。您将如何用 powershell 表达这一点?

更具体地说,我正在尝试将EPPlus 与 Powershell 一起使用来生成 excel 文档。但是,我在使用其单元格索引属性选择单元格时遇到问题。

我在Epplus' discussion forum 上发布了一个帖子,但我不完全确定从那里去哪里。

【问题讨论】:

    标签: powershell properties indexing indexer


    【解决方案1】:

    WorkBook.Cells 是一个 ExcelRange 对象,可通过Indexers 提供对单元格的访问。

    索引器是不直接转换为 PowerShell 的语法糖,请改用它:

    $WorkSheet.Cells.Item(1,1).Value = "Cell 1"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-28
      • 2013-06-16
      • 2010-10-14
      • 1970-01-01
      • 2018-09-02
      • 1970-01-01
      • 1970-01-01
      • 2010-11-08
      相关资源
      最近更新 更多