When query RSS/ATOM/ODATA xml data souce by using Invoke-RestMethod cmdlet. returned only about half of items.
$requestUrl = "http://blogs.msdn.com/b/powershell/rss.aspx"| #Register OnIdle event to load PS moduless. | |
| Register-EngineEvent -SourceIdentifier ([Management.Automation.PsEngineEvent]::OnIdle) -MaxTriggerCount 1 -Action { | |
| Import-Module TabExpansion++ | |
| #Import-Module FunctionExplorer | |
| Import-Module VariableExplorer | |
| Import-Module PSCodeAnalyzer.ISEAddin | |
| Import-Module Altrive.ISEExtensions | |
| #Remove current Job (No Need to get job result) | |
| $EventSubscriber.Action | Remove-Job -Force -ErrorAction Ignore |
| #Requires -Version 3.0 | |
| function Main | |
| { | |
| [Threading.Thread]::CurrentThread.CurrentCulture = "ja-jp" | |
| [Threading.Thread]::CurrentThread.CurrentUICulture = "en-us" | |
| $sw = [Diagnostics.Stopwatch]::StartNew() | |
| Write-Verbose ($LocalizedData.OperationStarted) -Verbose |
| $basePath = [Environment]::GetFolderPath([Environment+SpecialFolder]::MyDocuments) | |
| $targetPath = [Environment]::GetFolderPath([Environment+SpecialFolder]::AdminTools) | |
| Write-Host ("Get relative path") | |
| Write-Host ("From : {0}" -f $basePath) | |
| Write-Host ("To : {0}" -f $targetPath ) | |
| Write-Host ("Result: {0}" -f $ExecutionContext.SessionState.Path.NormalizeRelativePath($targetPath, $basePath)) |
| function Main | |
| { | |
| $sw = [Diagnostics.Stopwatch]::StartNew() | |
| 1..10 | % { | |
| Set-ISEStatusText ("Step.{0}: Executing operation..." -f $_) | |
| sleep 1 | |
| } | |
| Set-ISEStatusText ("Elapsed: {0}[ms]" -f $sw.ElapsedMilliseconds) -Force |
| $sw = [Diagnostics.stopwatch]::StartNew() | |
| sleep 1 | |
| Write-Host ("Elapsed: {0}[ms]" -f ($sw.ElapsedMilliseconds)) | |
| Write-Host ("Elapsed: {0}[ms]" -f ($sw.ElapsedMilliseconds)) |
| function Install-PSModule | |
| { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory)] | |
| [string] $ModuleName, | |
| [Parameter(Mandatory,ParameterSetName="Local")] | |
| [string] $Path, | |
| [ValidateSet("User","System","ProgramFiles","Local")] | |
| [string] $Target = "User" |
| function Main | |
| { | |
| #Execute Query(Note:Github Search API return up to 1000 results for each search.) | |
| $results = Find-GitHubRepository -Filter "language:powershell+created:>=2013-12-01&sort=stars" -Verbose | |
| #Show Results | |
| Write-Host ("Total Repositry Count : {0}" -f $results.total_count) | |
| Write-Host ("Returned Repository Count: {0}" -f $results.items.Count) | |
| $selectedItems = $results.items | select name, description, html_url, fork | Out-GridView -OutputMode Multiple |
| #TODO:support for non serializable object(example:PSCustomObject) | |
| function Out-HtmlView | |
| { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter()] | |
| [int]$Depth = 2, | |
| [Parameter(Mandatory,ValueFromPipeLine)] | |
| $InputObject | |
| ) |
PowerShell crash when calling ShowDialog for the second time. This error occurred when leaving PowerShell console for a long time(10-20 minutes)