cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
545
Views
0
Helpful
2
Replies

Commad output is blank rows

g.meghnagi
Level 1
Level 1

hi all,

i've tried to write a simple script for connect to multiple ucsm and perform simple action by executing command simultaneously, but the utput of the command are numerous empty lines, seems like the script work fine but the output is blank.

Can someone help me?

This is the script:

import-module Cisco.UCSManager

Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs $true

$UCSM_B = '10.X.X.X'

$UCSM_C = '10.X.X.X'

$UCSM_D = '10.X.X.X'

$UCSM_E = '10.X.X.X'

$UCSM_F = '10.X.X.X'

$UCSM_I = '10.X.X.X'

$UCSM_L = '10.X.X.X'

$UCSM_M = '10.X.X.X'

$UCSM_N = '10.X.X.X'

$UCSM_Z = '10.X.X.X'

$UCSM_LAB = '10.X.X.X'

$UCSM_toconnect_list = @()

Write-Host  "`nA quale UCSM vuoi accedere? `n`nUCSM-B`nUCSM-C`nUCSM-D`nUCSM-E`nUCSM-F`nUCSM-I`nUCSM-L`nUCSM-M`nUCSM-N`nUCSM-Z`nUCSM-LAB`n"

Write-host $UCSM_toconnect_list

while ($UCSM_toconnect -ne 'commit')

{

$UCSM_toconnect = Read-Host  "Server "

if ($UCSM_toconnect -eq 'UCSM-B')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_B"

}

   

elseif ($UCSM_toconnect -eq 'UCSM-C')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_C"

}

elseif ($UCSM_toconnect -eq 'UCSM-D')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_D"

}

elseif ($UCSM_toconnect -eq 'UCSM-E')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_E"

}

elseif ($UCSM_toconnect -eq 'UCSM-F')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_F"

}

elseif ($UCSM_toconnect -eq 'UCSM-I')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_I"

}

elseif ($UCSM_toconnect -eq 'UCSM-L')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_L"

}

elseif ($UCSM_toconnect -eq 'UCSM-M')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_M"

}

elseif ($UCSM_toconnect -eq 'UCSM-N')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_N"

}

elseif ($UCSM_toconnect -eq 'UCSM-Z')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_Z"

}

elseif ($UCSM_toconnect -eq 'UCSM-LAB')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_LAB"

}

elseif ($UCSM_toconnect -eq 'ALL-UCSM')

{

$UCSM_toconnect_list = $UCSM_toconnect_list + "$UCSM_B" + "$UCSM_C" + "$UCSM_D" + "$UCSM_E" + "$UCSM_F" + "$UCSM_I" + "$UCSM_L" + "$UCSM_M" + "$UCSM_N" +"$UCSM_Z" +"$UCSM_LAB"

}

}

Connect-Ucs $UCSM_toconnect_list

Write-Host "Operazioni possibili:"

Write-Host "1. Lista VLAN"

$Action = Read-Host -Prompt 'Quale operazione vuoi intraprendere? '

if ($Action -eq '1')

{

Get-UcsVlan

}

2 Replies 2

Orf Gelbrich
Cisco Employee
Cisco Employee

If there are any UCS director variables (vs. just powershell variables ) then the powershell variables will have to be escaped. \$var

Orf Gelbrich
Cisco Employee
Cisco Employee

Further on the server that has the PAS agent running there isa log in a cisco directory. That should provide some guidance on what went wrong.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Cisco UCS X-Series Energy Efficiency Offer