RecentDocs/RecentDocs.psm1
<#
.SYNOPSIS Gets the Document types available in Recents. .DESCRIPTION The Get-Recents cmdlet Gives the Names of Documents that are available to get the recents in this Computer. .EXAMPLE PS> Get-Recents All the Recents of this Computer have : .xlsx .docx .iso #> Function Get-Recents { echo " " echo "All the Recents of this Computer have : " echo " " Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.*" | select -ExpandProperty pschildname } <# .SYNOPSIS Gets the Document Names from Recents. .DESCRIPTION The Get-RecentDocs cmdlet Gives the Names of Documents that were opened recently on this computer. .EXAMPLE PS> Get-RecentDocs -DocName xls The Recent Documents are : 2016-cycle-passwords.xls22016-cycle-passwords.xls.lnkj ï¾.2016-cycle-passwords.xls.lnk, #> Function Get-RecentDocs { param ( [parameter(Mandatory=$true)] [string[]] $DocName ) $PoR = Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.$DocName" | Get-member | select -ExpandProperty name $Count = 0 $value = $null while ($Count -ine 40) { if ($PoR.Contains($Count) -eq 'true') { [System.Array]$value += "$Count" } $Count++ } $Count = 0 $CountCon = 0 $new = $null $MainVal = $null while ($Count -ine $value.count) { $data = Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.$DocName" | Get-ItemPropertyValue -name $value[$Count] $CountCon = 0 while ($CountCon -ine $data.Count ) { if ($data[$CountCon] -ine 0 ){ $r = $data[$CountCon].Tostring() $new += [char][int]$r } $CountCon = $CountCon + 1 } [System.Array]$MainVal += $new $new = $null $Count++ } $Count = 0 Write-Output " " write-output "The Recent Documents are : " Write-Output " " while ($Count -ine $MainVal.count) { Write-Output $MainVal[$Count] Write-Output " " $Count++ } } |