Add deprecation for PowerShell 3/4 to Profile psm1

This commit is contained in:
maddieclayton 2018-01-31 17:01:32 -08:00
Родитель e1fc4f26c6
Коммит 0e28918e01
3 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Current Release
* Added deprecation warning for PowerShell 3 and 4
* `Add-AzureRmAccount` has been renamed as `Connect-AzureRmAccount`; an alias has been added for the old cmdlet name, and other aliases (`Login-AzAccount` and `Login-AzureRmAccount`) have been redirected to the new cmdlet name.
* `Remove-AzureRmAccount` has been renamed as `Disconnect-AzureRmAccount`; an alias has been added for the old cmdlet name, and other aliases (`Logout-AzAccount` and `Logout-AzureRmAccount`) have been redirected to the new cmdlet name.
* Corrected Resource Strings to use Connect-AzureRmAccount instead of Login-AzureRmAccount

Просмотреть файл

@ -38,6 +38,10 @@ if ($PSVersionTable.PSVersion.Major -ge 5)
Register-ArgumentCompleter -CommandName $_.Command -ParameterName $_.Parameter -ScriptBlock $sb
}
}
else
{
%PSVersionDeprecationMessage%
}
$FilteredCommands = %DEFAULTRGCOMMANDS%

Просмотреть файл

@ -67,6 +67,17 @@ function Create-ModulePsm1
$template = $template -replace "%DATE%", [string](Get-Date)
$template = $template -replace "%IMPORTED-DEPENDENCIES%", $importedModules
if ($ModulePath -like "*Profile*")
{
Write-Host "here"
$template = $template -replace "%PSVersionDeprecationMessage%", "Write-Warning `"PowerShell version 3 and 4 will no longer be supported starting in May 2018. Please update to the latest version of PowerShell 5.1`""
}
else
{
Write-Host "here1"
$template = $template -replace "%PSVersionDeprecationMessage%", ""
}
$completerCommands = Find-CompleterAttribute -ModuleMetadata $ModuleMetadata -ModulePath $ModulePath -IsRMModule $IsRMModule
$template = $template -replace "%COMPLETERCOMMANDS%", $completerCommands