Commad output is blank rows

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2018 02:27 AM - edited 03-01-2019 06:26 AM
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
}
- Labels:
-
PowerShell
-
Troubleshooting
-
UCS Director

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2018 10:08 AM
If there are any UCS director variables (vs. just powershell variables ) then the powershell variables will have to be escaped. \$var

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2018 10:08 AM
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.
