GUID = '57a6bea3-0ea5-44b3-95d2-71d122772f1c'
Author = 'Ardis Lu'
Description = 'My personal utility functions.'
- FunctionsToExport = @('Invoke-RandomFile', 'ConvertTo-Base64String', 'Get-StringHash', 'Get-SizeDurationRatio', 'Get-ExtendedFileProperty', 'Get-DocumentationIP', 'Get-DocumentationPhoneNumber', 'Test-TcpPort', 'Get-HelpAsMarkdown', 'Open-ParentFolder', 'Get-SubresourceIntegrity', 'Open-TemporaryBrowser')
+ FunctionsToExport = @('Invoke-RandomFile', 'ConvertTo-Base64String', 'Get-StringHash', 'Get-SizeDurationRatio', 'Get-ExtendedFileProperty', 'Get-DocumentationIP', 'Get-DocumentationPhoneNumber', 'Test-TcpPort', 'Get-HelpAsMarkdown', 'Open-ParentFolder', 'Get-SubresourceIntegrity', 'Open-TemporaryBrowser', 'Open-HistoryFile')
CmdletsToExport = @()
VariablesToExport = @()
AliasesToExport = @()
[System.Diagnostics.Process]::Start($execPath, "--user-data-dir=`"$temp`" $(if ($CORS) {'--disable-web-security'})") | Out-Null
}
}
+
+function Open-HistoryFile {
+ <#
+ .SYNOPSIS
+ Opens the current session's persistent history file in a text editor.
+
+ .DESCRIPTION
+ Besides the in-memory session history which can be retrieved using Get-History, the PSReadLine module also
+ maintains a persistent history of commands in a text file saved on disk. This command locates this text
+ file using (Get-PSReadlineOption).HistorySavePath then opens it using Invoke-Item.
+
+ .EXAMPLE
+ PS> Open-HistoryFile
+
+ Opens the default text editor on the persistent history file.
+ #>
+
+ process {
+ Invoke-Item (Get-PSReadlineOption).HistorySavePath
+ }
+}