PS C:\Users\Me> $profile | Format-List -Force
AllUsersAllHosts : C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
AllUsersCurrentHost : C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
CurrentUserAllHosts : C:\Users\Me\Documents\WindowsPowerShell\profile.ps1
CurrentUserCurrentHost : C:\Users\Me\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Length : 72
PS C:\Users\Me> Get-PSReadlineOption
EditMode : Windows
ContinuationPrompt : >>
ContinuationPromptForegroundColor : DarkYellow
ContinuationPromptBackgroundColor : DarkMagenta
ExtraPromptLineCount : 0
AddToHistoryHandler :
CommandValidationHandler :
CommandsToValidateScriptBlockArguments : {ForEach-Object, %, Invoke-Command, icm...}
HistoryNoDuplicates : False
MaximumHistoryCount : 4096
MaximumKillRingCount : 10
HistorySearchCursorMovesToEnd : False
ShowToolTips : False
DingTone : 1221
CompletionQueryItems : 100
WordDelimiters : ;:,.[]{}()/\|^&*-=+'"--?
DingDuration : 50
BellStyle : Audible
HistorySearchCaseSensitive : False
ViModeIndicator : None
HistorySavePath : C:\Users\Me\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHos
t_history.txt
HistorySaveStyle : SaveIncrementally
DefaultTokenForegroundColor : DarkYellow
CommentForegroundColor : DarkGreen
KeywordForegroundColor : Green
StringForegroundColor : DarkCyan
OperatorForegroundColor : DarkGray
VariableForegroundColor : Green
CommandForegroundColor : Yellow
ParameterForegroundColor : DarkGray
TypeForegroundColor : Gray
NumberForegroundColor : White
MemberForegroundColor : White
DefaultTokenBackgroundColor : DarkMagenta
CommentBackgroundColor : DarkMagenta
KeywordBackgroundColor : DarkMagenta
StringBackgroundColor : DarkMagenta
OperatorBackgroundColor : DarkMagenta
VariableBackgroundColor : DarkMagenta
CommandBackgroundColor : DarkMagenta
ParameterBackgroundColor : DarkMagenta
TypeBackgroundColor : DarkMagenta
NumberBackgroundColor : DarkMagenta
MemberBackgroundColor : DarkMagenta
EmphasisForegroundColor : Cyan
EmphasisBackgroundColor : DarkMagenta
ErrorForegroundColor : Red
ErrorBackgroundColor : DarkMagenta
Так перенести историю в другое место пробовали ?
какая именно из многочисленных вторых версий у вас ?
Get-Module -list PSReadline | fl *
Windows PowerShell
(C) Корпорация Майкрософт (Microsoft Corporation), 2016. Все права защищены.
PS C:\Users\Me> get-module -list psreadline | fl *
LogPipelineExecutionDetails : False
Name : PSReadLine
Path : C:\Program Files\WindowsPowerShell\Modules\PSReadLine\PSReadLine.psd1
ImplementingAssembly :
Definition :
Description : Great command line editing in the PowerShell console host
Guid : 5714753b-2afd-4492-a5fd-01d9e2cff8b5
HelpInfoUri : https://go.microsoft.com/fwlink/?LinkId=528806
ModuleBase : C:\Program Files\WindowsPowerShell\Modules\PSReadLine
PrivateData : {PSData}
Tags : {}
ProjectUri :
IconUri :
LicenseUri :
ReleaseNotes :
RepositorySourceLocation :
Version : 2.0.0
ModuleType : Script
Author : Microsoft Corporation
AccessMode : ReadWrite
ClrVersion : 4.0.0
CompanyName : Microsoft Corporation
Copyright : (c) Microsoft Corporation. All rights reserved.
DotNetFrameworkVersion : 4.6.1
ExportedFunctions : {[PSConsoleHostReadLine, PSConsoleHostReadLine]}
Prefix :
ExportedCmdlets : {[Get-PSReadLineKeyHandler, Get-PSReadLineKeyHandler], [Set-PSReadLineKeyHandler, Set-PSR
eadLineKeyHandler], [Remove-PSReadLineKeyHandler, Remove-PSReadLineKeyHandler], [Get-PSRe
adLineOption, Get-PSReadLineOption]...}
ExportedCommands : {[Get-PSReadLineKeyHandler, Get-PSReadLineKeyHandler], [Set-PSReadLineKeyHandler, Set-PSR
eadLineKeyHandler], [Remove-PSReadLineKeyHandler, Remove-PSReadLineKeyHandler], [Get-PSRe
adLineOption, Get-PSReadLineOption]...}
FileList : {}
CompatiblePSEditions : {}
ModuleList : {}
NestedModules : {Microsoft.PowerShell.PSReadLine2}
PowerShellHostName :
PowerShellHostVersion :
PowerShellVersion : 5.0
ProcessorArchitecture : None
Scripts : {}
RequiredAssemblies : {}
RequiredModules : {}
RootModule : PSReadLine.psm1
ExportedVariables : {}
ExportedAliases : {}
ExportedWorkflows : {}
ExportedDscResources : {}
SessionState :
OnRemove :
ExportedFormatFiles : {C:\Program Files\WindowsPowerShell\Modules\PSReadLine\PSReadLine.format.ps1xml}
ExportedTypeFiles : {}
PS C:\Users\Me>
можно visual studio code использовать.Да вспомнил - Павершел уже можно и во многих других IDE разрабатывать.
Ну логично, что если есть Get-PSReadLineOption, то есть и Set-PSReadLineOption -HistorySavePath 'D:\111'
$historyPath = "$env:USERPROFILE\PowerShell_History.xml"
if (Test-Path -Path $historyPath) {
Add-History (Import-Clixml $historyPath)
}
else {
Write-Warning "$historyPath does not exist. Unable to restore command history"
}
Register-EngineEvent -SupportEvent PowerShell.Exiting -Action { Get-History | Export-Clixml -Path $historyPath -Encoding ASCII}
я-то ISE не пользуюсь вообще...
Set-PSReadLineKeyHandler -Chord Tab -Function MenuComplete