equelin / Unity-Powershell

PowerShell module for managing EMC Unity arrays

Home Page:https://www.powershellgallery.com/packages/Unity-Powershell/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running Connect-Unity via non-interactive Powershell causes an exception

RamonBertrand opened this issue · comments

Please makes sure these boxes are checked before submitting your issue (put an X between the brackets).

  • Check that your Powershell version > 5.0 (Bonus point if you are using the latest version available)
  • Check that you follow the instructions for installing the module

Also, please provide:

  • Any instructions that may help to reproduce the problem
    When running a Powershell script command headless (for example via Azure Automation), the following Exception occurs.

Exception setting "WindowTitle": "A command that prompts the user failed because the host program or the command type do es not support user interaction. Try a host program that supports user interaction, such as the Windows PowerShell Conso le or Windows PowerShell ISE, and remove prompt-related commands from command types that do not support user interaction , such as Windows PowerShell workflows." At line:13 char:2 + $host.ui.RawUI.WindowTitle = $strNewWindowTitle + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], SetValueInvocationException + FullyQualifiedErrorId : ExceptionWhenSetting

This seems to be caused by a tilebar update in the Connect-Unity command, which can only be performed when Powershell is executing interactively.

To reproduce, run this script via Azure Automation:

$UserName = 'xxxxxxx'
$SecurePassword = 'yyyyyyyyyyyy' | ConvertTo-SecureString -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential ($UserName, $SecurePassword)
$IPAddress = 'ipipipipipip'
Connect-Unity -Server $IPAddress -Username $UserName -Password $SecurePassword -TrustAllCerts $true
  • Informations about your host $PSVerionTable
  • The list of the loaded modules Get-Module

$psversiontable
Name Value


PSVersion 5.1.14409.1012
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1012
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

ModuleType Version Name ExportedCommands


Script 1.0.0.0 ISE {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
Manifest 3.0.0.0 Microsoft.PowerShell.Security {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-AuthenticodeSignature...}
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Manifest 3.0.0.0 Microsoft.WSMan.Management {Connect-WSMan, Disable-WSManCredSSP, Disconnect-WSMan, Enable-WSManCredSSP...}
Binary 1.16.6.0 PureStoragePowerShellSDK {Add-PfaArrayToPod, Add-PfaHostGroupsToProtectionGroup, Add-PfaHostIqns, Add-PfaHostNqn...}
Script 0.16.1 Unity-Powershell {Connect-Unity, Disable-UnityFastCache, Disconnect-Unity, Enable-UnityFastCache...}