SebSop
Contributor
Contributor

Rediscover Adapter via PowerCLI

Hello Folks

I am currently writing a little PowerCLI Script for Automated ESXi Installation.

I need to run this esxcli command via PowerCLI

esxcli iscsi adapter discovery rediscover --adapter=vmhba64

but can't make it.

A simple rediscover of an Adapter is sadly not as simple as it is via esxcli.

What I tried so far:

$esxCLI = Get-EsxCli -VMHost [HOSTNAME] -V2

$esxcli.iscsi.adapter.discovery.rediscover --adapter=vmhba64

 

$esxCLI = Get-EsxCli -VMHost [HOSTNAME] -V2

$esxcli.iscsi.adapter.discovery.rediscover -adapter vmhba64

 

 

$esxCLI = Get-EsxCli -VMHost [HOSTNAME]-V2

$cArgs = $esxcli.iscsi.adapter.discovery.rediscover.add.CreateArgs()
$cArgs.adapter = 'vmhba64'
$esxcli.iscsi.adapter.discovery.rediscover.Invoke($cArgs)

But nothing worked.

Could you please advise how to do a rediscover via PowerCLI?

 

Thank you in advance for your help.

 

Best Wishes


Sebastian

Tags (2)
0 Kudos
0 Replies