组合两个 Cmdlet 的输出以获得公共输出

发布于 2024-11-29 03:49:42 字数 1589 浏览 0 评论 0原文

我想从 Net App commandlet 中提取 filerview,我在下面写了一个表达式

Get-NaLun | Select @{Name="LUN";Expression={$_.path}},@{Name="Size";Expression=     {[math]::Round([decimal]$_.size/1gb,0)}},`
@{Name="OnlineStatus";Expression={$_.online}},`
@{Name="Group";Expression={([string]::Join(",",(Get-NaLun $_.path | get-nalunmap | select -ExpandProperty initiatorgroupname)))}},`
@{Name="LunID";Expression={Get-NaLun $_.path | get-nalunmap | select -ExpandProperty lunid}} | Export-Csv "c:\LUN_FilerView.csv"

我想要的是可以根据 LUN ID、启动器组名称进行搜索(

如果我可以获得 cmdlet)

  1. 我还想运行“Get-NaLUNbyMap” ” 使用特定的 igroup 映射和 LUN ID,并使用映射到该 LUN ID 的 LUN 进行响应
  2. Get-naLunByMap –igroup SEAPSQLPWS1_Cluster_Nodes – LunID 7

有人可以帮帮我吗谢谢!

这是输出

PS 103 >  Get-NaLun /vol/Co4_I_UserDB

Path                                      TotalSize Protocol     Online Mapped  Thin  Comment
----                                      --------- --------     ------ ------  ----  -------
/vol/Co4_I_UserDB   100.0 GB windows_2008  True   True   True  TEST - Authoring UserDBs

PS 104 >  Get-NaLunmap /vol/Co4_I_UserDB


InitiatorGroupName            : IA
InitiatorGroupType            : iscsi
Initiators                    : {i, iqn.1991-05.com.microsoft:}
InitiatorGroupOsType          : windows
InitiatorGroupPortsetName     :
InitiatorGroupThrottleBorrow  : False
InitiatorGroupThrottleReserve : 0
InitiatorGroupUsePartner      :
InitiatorGroupAluaEnabled     : False
InitiatorGroupVsaEnabled      : False
LunId                         : 14

I wanted to extract a filerview from Net App commandlets, i wrote a an expression below

Get-NaLun | Select @{Name="LUN";Expression={$_.path}},@{Name="Size";Expression=     {[math]::Round([decimal]$_.size/1gb,0)}},`
@{Name="OnlineStatus";Expression={$_.online}},`
@{Name="Group";Expression={([string]::Join(",",(Get-NaLun $_.path | get-nalunmap | select -ExpandProperty initiatorgroupname)))}},`
@{Name="LunID";Expression={Get-NaLun $_.path | get-nalunmap | select -ExpandProperty lunid}} | Export-Csv "c:\LUN_FilerView.csv"

What i wanted is it possible to search based on the LUN ID, Initiator Group Name

if i can get a cmdlet

  1. I would also like to run “Get-NaLUNbyMap” with a specific igroup map and LUN ID and have it respond with the LUN that is mapped at that LUN ID
  2. Get-naLunByMap –igroup SEAPSQLPWS1_Cluster_Nodes – LunID 7

Can some one help me thanks!

here is the output of

PS 103 >  Get-NaLun /vol/Co4_I_UserDB

Path                                      TotalSize Protocol     Online Mapped  Thin  Comment
----                                      --------- --------     ------ ------  ----  -------
/vol/Co4_I_UserDB   100.0 GB windows_2008  True   True   True  TEST - Authoring UserDBs

PS 104 >  Get-NaLunmap /vol/Co4_I_UserDB


InitiatorGroupName            : IA
InitiatorGroupType            : iscsi
Initiators                    : {i, iqn.1991-05.com.microsoft:}
InitiatorGroupOsType          : windows
InitiatorGroupPortsetName     :
InitiatorGroupThrottleBorrow  : False
InitiatorGroupThrottleReserve : 0
InitiatorGroupUsePartner      :
InitiatorGroupAluaEnabled     : False
InitiatorGroupVsaEnabled      : False
LunId                         : 14

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

盛夏已如深秋| 2024-12-06 03:49:42

我认为 DataONTAP PowerShell 工具包中内置的 Get-NaLunByIgroup cmdlet 正是您所寻找的:

PS C:\> Get-NaLunByIgroup xyratex 1

Path                                      TotalSize Protocol     Online Mapped  Thin  Comment
----                                      --------- --------     ------ ------  ----  -------
/vol/nicholsondev2k8/lun                    80.0 GB windows_2008  True   True   True

此外,您还可以查看 Get-NaHostDisk 和/或 Get-NaHyperV 以将 Windows 磁盘映射回 NetApp 存储。

I think the Get-NaLunByIgroup cmdlet built in to the DataONTAP PowerShell Toolkit is what you are looking for:

PS C:\> Get-NaLunByIgroup xyratex 1

Path                                      TotalSize Protocol     Online Mapped  Thin  Comment
----                                      --------- --------     ------ ------  ----  -------
/vol/nicholsondev2k8/lun                    80.0 GB windows_2008  True   True   True

Also, you might take a look at Get-NaHostDisk and/or Get-NaHyperV for mapping Windows disks back to NetApp storage.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文