Created
September 27, 2020 15:45
-
-
Save aadennis/68922d538ebfc64fe747e5fb43bd6432 to your computer and use it in GitHub Desktop.
dependency for DockerUtilities.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Get the name of each function in the given PowerShell Script. | |
Assumptions: | |
1. the line starts with "function". | |
2. A line starting with "function" is not embedded in a comment block. | |
There is no error handling. | |
#> | |
function Get-FunctionsInScript($script) { | |
Get-Content $script | ForEach-Object { | |
$currentLine = $_ | |
if ($currentLine.startswith("function")) { | |
$functionList += "$currentLine`r`n" | |
} | |
} | |
$functionList | |
} | |
Function Get-FullHistory() { | |
$historyFile = (Get-PSReadlineOption).HistorySavePath | |
Write-Host "path = [$historyFile]" | |
Get-Content $historyFile | sort | Get-Unique > c:/temp/PsHistory.txt | |
$hash = @{} | |
gc $historyFile | % {if ($hash.$_ -eq $null) { $_}; $hash.$_ = 1} > c:/temp/PsHistory2.txt | |
} | |
#Get-FullHistory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment