4 thoughts on “PowerCLI discord

  1. hi im trying to use the script that called Script to list VM Network

    $reportedvms=New-Object System.Collections.ArrayList
    $vms=get-view -viewtype virtualmachine

    foreach($vm in $vms){
    $reportedvm = New-Object PSObject
    Add-Member -Inputobject $reportedvm -MemberType noteProperty -name Guest -value $vm.Name
    Add-Member -InputObject $reportedvm -MemberType noteProperty -name UUID -value $($vm.Config.Uuid)
    foreach($ntwkcard in $networkcards){
    Add-Member -InputObject $reportedvm -MemberType NoteProperty -Name “networkcard${i}.Network” -Value $ntwkcard.Network
    Add-Member -InputObject $reportedvm -MemberType NoteProperty -Name “networkcard${i}.MacAddress” -Value $ntwkcard.Macaddress
    Add-Member -InputObject $reportedvm -MemberType NoteProperty -Name “networkcard${i}.IpAddress” -Value $($ntwkcard.IpAddress|?{$_ -like “*.*”})
    Add-Member -InputObject $reportedvm -MemberType NoteProperty -Name “networkcard${i}.Device” -Value $(($vm.config.hardware.device|?{$_.key -eq $($ntwkcard.DeviceConfigId)}).gettype().name)

    $reportedvms|Export-Csv c:\test.csv

    #### bu i always get the following in my CSV , please help mt to solve it 🙂


  2. Hi, I am using system center orchestrator and attempting to call powercli via .net script module.
    I run the following
    Add-PSSnapin VMware.VimAutomation.Core
    connect-viserver -server IPv6_address -User Username -Password password

    I keep receiving that it fails, reporting that “the term connect-viserver is not recognized”
    Any ideas as to were I am screwing up?

  3. Hi I’m trying to modify the IIS header setting and getting below error.

    c:\Windows\System32\inetsrv>appcmd.exe set config /section:system.webServer/http
    Protocol /+”customHeaders.[name=’Content-Security-Policy’,value= default-src htt
    ps: data: ‘unsafe-inline’ ‘unsafe-eval’]”

    ERROR ( message:Malformed collection indexer; format is [@position,name=’value’,
    name2=’value2′,…]. The @position specifier is optional, and be ‘@start’, ‘@en
    d’, or ‘@N’ where N is a numeric index into the collection. )

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s