< Back

Invoke-HPECmdletMigration

Tue Jan 14, 2020 1:44 am

NAME Invoke-HPECmdletMigration



SYNOPSIS

The Invoke-HPECmdletMigration provides migration suggestion for HPE Cmdlets.





SYNTAX

Invoke-HPECmdletMigration -ScriptFile <String> -CmdletModule <String[]> [-ExportToCSV <SwitchParameter>]

[<CommonParameters>]





DESCRIPTION

The Cmdlet Invoke-HPECmdletMigration provides migration advises for the breaking changes in Cmdlet, parameter,

property and value in the new HPE cmdlet module.



The Cmdlet migration suggestions are categorised as below

. New :- The cmdlet introduced in the latest release which is required to use with existing cmdlets.

. Rename :- The existing Cmdlet, parameter, property and value are renamed.

. Classify :- The existing Cmdlet parameter(s)/properties are regrouped into new Cmdlet.

. Merge :- The existing Cmdlet parameters/properties are merge into new Cmdlet.

. Fragment :- The existing Cmdlet parameters/properties are splited into the new Cmdlet.

. Obsolete :- The existing Cmdlet is no more supported in new module.



This Cmdlet provide migration suggestion for the following items

1) Cmdlet module name

2) Cmdlet

3) Parameter

4) Property

5) Value





PARAMETERS

-ScriptFile <String>

Specify the valid powerShell script file path. It accepts only .psm1 and .ps1 file.



Required? true

Position? named

Default value None

Accept pipeline input? false

Accept wildcard characters? false



-CmdletModule <String[]>

Specify the Cmdlet module(s) whose cmdlets are used in the PowerShell script file. The migration suggestion

are provided only for the specified modules.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ExportToCSV [<SwitchParameter>]

This parameter is used to export the migration suggestions into CSV. The CSV file get created in the same

directory of the input script file. CSV file name has "MigrationAdvise_" prefix with the input script file

name.



Required? false

Position? named

Default value false

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String







OUTPUTS

CmdletChangeItem[]







NOTES





1) This Cmdlet provides suggestion based on Cmdlets recognised as PowerShell cmdlet token. If the Cmdlet is

passed as string and invoke through Invoke-Command then no suggestion will provided for such Cmdlets.

2) When migrating to the new cmdlet whose change type is "Classify", "Merge", and "Fragment", make sure the

mandatory parameter must be provided to the cmdlet.



EXAMPLE 1



C:\\PS> $returnObj = Invoke-HPECmdletMigration -ScriptFile C:\\TestScript.ps1 -CmdletModule HPBIOSCmdlets

C:\\PS> $returnObj[0]





ChangeType : Rename

LineNumber : 3

LinePosition : 1

Severity : High

Cmdlet : Existing : Set-HPBIOSBootMode; New : Set-HPEBIOSBootMode

Message : The existing cmdlet, parameter, property, and value are renamed.

Parameter :

ParameterReference :

Property :

PropertyReference :

Value : {UEFI_Mode}

ValueReference : {UEFI_Mode}



Above example return list of suggested items. Each item in the list has above mentioned properties.

EXAMPLE 2



C:\\PS> $returnObject = Invoke-HPECmdletMigration -ScriptFile C:\\CaseSens.ps1 -CmdletModule HPBIOSCmdlets



C:\\PS> $returnObject





ChangeType : Rename

LineNumber : 1

LinePosition : 9

Severity : High

Cmdlet : Existing : Connect-HPBIOS; New : Connect-HPEBIOS

Message : The existing cmdlet, parameter, property, and value are renamed.

Parameter :

ParameterReference :

Property :

PropertyReference :

Value :

ValueReference :



ChangeType : Rename

LineNumber : 5

LinePosition : 8

Severity : High

Cmdlet : Existing : Get-HPBIOSAdvancedMemoryProtection; New : Get-HPEBIOSAdvancedMemoryProtection

Message : The existing cmdlet, parameter, property, and value are renamed.

Parameter :

ParameterReference :

Property :

PropertyReference :

Value : {Mirrored Memory with Advanced ECC Support}

ValueReference : {Mirrored Memory with Advanced ECC Support}







C:\\PS> $d[1].ValueReference



LineNumber LinePosition Name

---------- ------------ ----

7 38 Mirrored Memory with Advanced ECC Support







C:\\PS> $d[1].Value



ExistingValue NewValue

------------- --------

Mirrored Memory with Advanced ECC Support MirroredMemoryAdvancedECCSupport



above example shows the Value and ValueReference for the migration changes.

EXAMPLE 3



PS C:\\> $returnObject = Invoke-HPECmdletMigration .\\PowerModeConfigurations.ps1 -CmdletModule HPBIOSCmdlets



PS C:\\> $returnObject





ChangeType : Rename

LineNumber : 7

LinePosition : 30

Severity : High

Cmdlet : Existing : Set-HPBIOSPowerprofile; New : Set-HPEBIOSPowerProfile

Message : The existing cmdlet, parameter, property, and value are renamed.

Parameter : {HPPowerProfile}

ParameterReference : {HPPowerProfile}

Property : {StatusType}

PropertyReference : {StatusType}

Value : {Balanced}

ValueReference : {Balanced}



ChangeType : Rename

LineNumber : 24

LinePosition : 30

Severity : High

Cmdlet : Existing : Set-HPBIOSPowerProfile; New : Set-HPEBIOSPowerProfile

Message : The existing cmdlet, parameter, property, and value are renamed.

Parameter : {HPPowerProfile}

ParameterReference : {hpPowerprofile}

Property :

PropertyReference :

Value : {Balanced, Maximum_Performance}

ValueReference : {balanced, maximum_Performance}



ChangeType : Rename

LineNumber : 30

LinePosition : 2

Severity : High

Cmdlet : Existing : Set-HPBIOSPowerProfile; New : Set-HPEBIOSPowerProfile

Message : The existing cmdlet, parameter, property, and value are renamed.

Parameter : {hppowerprofile}

ParameterReference : {hppowerprofile}

Property :

PropertyReference :

Value : {balanced}

ValueReference : {balanced}







PS C:\\> $returnObject [0].Parameter



ExistingName NewName

------------ -------

HPPowerProfile PowerProfile







PS C:\\> $returnObject [0].ParameterReference



LineNumber LinePosition Name

---------- ------------ ----

2 24 HPPowerProfile







PS C:\\> $returnObject [0].Value



ExistingValue NewValue

------------- --------

Balanced BalancedPowerAndPerformance







PS C:\\> $returnObject [0].ValueReference



LineNumber LinePosition Name

---------- ------------ ----

2 40 Balanced



Above example shows migration changes for Cmdlet,Parameter,Property, and Value with reference for the items in the

script file.

EXAMPLE 4



PS C:\\>$returnObject = Invoke-HPECmdletMigration .\\BootModeConfigurations.ps1 -CmdletModule HPiLOCmdlets



PS C:\\> $returnObject[1]





ChangeType : Merge

LineNumber : 149

LinePosition : 10

Severity : High

Cmdlet : Existing : Get-HPiLOSupportedBootMode New : Get-HPEiLOBootMode

Message : The existing cmdlet's parameter(s)/properties are merge to the new cmdlet.

Parameter : {Server, Credential, DisableCertificateAuthentication}

ParameterReference : {Server, Credential, DisableCertificateAuthentication}

Property : {STATUS_TYPE}

PropertyReference : {STATUS_TYPE}

Value :

ValueReference :



PS C:\\> $returnObject[4]



ChangeType : Rename

LineNumber : 187

LinePosition : 18

Severity : High

Cmdlet : Existing : Set-HPiLOPendingBootMode New : Set-HPEiLOBootMode

Message : The existing cmdlet, parameter, property, and value are renamed.

Parameter : {Server, Credential, BootMode, DisableCertificateAuthentication}

ParameterReference : {Server, Credential, BootMode, DisableCertificateAuthentication}

Property : {STATUS_TYPE}

PropertyReference : {STATUS_TYPE}

Value :

ValueReference :



Above example shows the ChangeType 'Classify'. In this case, Parameter 'ThermalShutdwon' has been moved from

Set-HPBIOSServerAvailability to Set-HPEBIOSThermalOption. In such cases Parameter/Property reference will not be

availiable.

EXAMPLE 5



PS C:\\> $returnObject = Invoke-HPECmdletMigration -ScriptFile C:\\powerTest.ps1 -CmdletModule HPBIOSCmdlets



PS C:\\> $returnObject[0]





ChangeType : Rename

LineNumber : 7

LinePosition : 30

Severity : High

Cmdlet : Existing : Set-HPBIOSPowerprofile; New : Set-HPEBIOSPowerProfile

Message : The existing cmdlet, parameter, property, and value are renamed.

Parameter : {HPPowerProfile}

ParameterReference : {HPPowerProfile}

Property : {StatusType}

PropertyReference : {StatusType}

Value : {Balanced}

ValueReference : {Balanced}









PS C:\\> $returnObject[0].GetAdditionalMigrationInfo()



ChangeItem Existing New

---------- -------- ---

Parameter HPPowerProfile PowerProfile

Value Balanced BalancedPowerAndPerformance

Value Maximum Performance MaximumPerformance

Value Maximum_Performance MaximumPerformance

Value Minimum Power MinimumPowerUsage

Value Minimum_Power MinimumPowerUsage

Property StatusType Status

Property StatusMessage StatusInfo



Above example shows the migration suggestion for the Set-HPBIOSPowerProfile. GetAdditionalMigrationInfo() return

all the migration changes for the Cmdlet Set-HPBIOSPowerProfile.

EXAMPLE 6



C:\\PS> $returnObject = Invoke-HPECmdletMigration C:\\BootModeConfigurations.ps1 -CmdletModule HPiLOCmdlets

-ExportToCSV -Verbose



VERBOSE: Validating input script file.

VERBOSE: Migration advisory operation started.

VERBOSE: Exporting to migration advisory data to CSV.

VERBOSE: Migration advisory details exported to C:\\MigrationAdvise_BootModeConfigurat

ions.csv

VERBOSE: Migration advisory operation completed.



Above example shows the the migration changes are exported to CSV file.



RELATED LINKS