Add deprecation for PowerShell 3/4 to Profile psm1
This commit is contained in:
Родитель
e1fc4f26c6
Коммит
0e28918e01
|
@ -18,6 +18,7 @@
|
||||||
- Additional information about change #1
|
- Additional information about change #1
|
||||||
-->
|
-->
|
||||||
## Current Release
|
## 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.
|
* `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.
|
* `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
|
* 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
|
Register-ArgumentCompleter -CommandName $_.Command -ParameterName $_.Parameter -ScriptBlock $sb
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%PSVersionDeprecationMessage%
|
||||||
|
}
|
||||||
|
|
||||||
$FilteredCommands = %DEFAULTRGCOMMANDS%
|
$FilteredCommands = %DEFAULTRGCOMMANDS%
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,17 @@ function Create-ModulePsm1
|
||||||
$template = $template -replace "%DATE%", [string](Get-Date)
|
$template = $template -replace "%DATE%", [string](Get-Date)
|
||||||
$template = $template -replace "%IMPORTED-DEPENDENCIES%", $importedModules
|
$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
|
$completerCommands = Find-CompleterAttribute -ModuleMetadata $ModuleMetadata -ModulePath $ModulePath -IsRMModule $IsRMModule
|
||||||
$template = $template -replace "%COMPLETERCOMMANDS%", $completerCommands
|
$template = $template -replace "%COMPLETERCOMMANDS%", $completerCommands
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче