filter Find-Function
{
&nbs
p; $path = $_.FullN
ame
$lastwr
ITe = $_.LastWriteTime
$text = Get-Content -Path $path
if ($text.Length -gt 0)
{
$token = $null
$errors = $null
$ast = [
System.Management.Automation.Language.Parser]
::Pars
einput($text, [ref] $token, [ref] $errors)
$ast.FindAll({ $
args[0]
-is [System.Management.Automation.Language.FunctionDefinitionAst] }, $true) |
Select-Object -
PRo
PErty Name, Path, LastWriteTime |
For
each-Object {
$_.Path = $path
$_.LastWriteTime = $lastwrite
$_
}
}
}
PS> dir $home -Filter *.
ps1 -Recurse -Exclude *.ps1
XMl | Find-Function
Name Path LastWriteTime
---- ---- -------------
Inject-
LOGonC
redentials C:\Users\Tobias\Desktop
... 06.01.2014 02:43:00
@R_
360_2187@-Command C:\Users\Tobias\Desktop... 06.03.2014 10:17:02
Test C:\Users\Tobias\Desktop... 30.01.2014 09:32:20
Get-WebPictureOri
ginal C:\Users\Tobias\Desktop... 11.12.2013 11:37:53
Get-ConnectionString C:\Users\Tobias\Documen... 23.05.2014 10:49:09
Convert
-sID2User C:\Users\Tobias\Documen... 23.05.2014 15:33:06
Lock-Screen C:\Users\Tobias\Documen... 19.03.2014 12:51:54
Show-OpenFileDialog C:\Users\Tobias\Documen... 16.05.2014 13:42:16
Show-UniversalData C:\Users\Tobias\Documen... 16.05.2014 13:23:20
Start
-timebombMemory C:\Users\Tobias\Documen... 23.05.2014 09:12:28
Stop-TimebombMemory C:\Users\Tobias\Documen... 23.05.2014 09:12:28
(...)