Skip to content

Instantly share code, notes, and snippets.

View kiyokura's full-sized avatar

Kiyokura Narami kiyokura

View GitHub Profile
@kiyokura
kiyokura / heroshima_ps_2.ps1
Created March 24, 2012 07:47
ヒーロー島 PowerShell ハンズオン 問題2
$logs = Get-EventLog Application |
?{($_.TimeWritten -ge (get-date).AddDays(-1)) -and ($_.EntryType -eq "Error" -or $_.EntryType -eq "Warning" -or $_.EntryType -eq "Information")}
$err_count=0
$warn_count = 0
$info_count = 0
foreach($d in $logs){
if($d.EntryType -eq 'Error'){
$err_count++
@kiyokura
kiyokura / heroshima_ps_1.ps1
Created March 24, 2012 07:45
ヒーロー島 PowerShell ハンズオン 問題1
Get-Process |?{$_.workingset -ge 100MB} | Export-Csv -Path C:\aaa.csv
@kiyokura
kiyokura / heroshima_ps_3_another.ps1
Created March 24, 2012 07:34
ヒーロー島 PowerShell ハンズオン 問題3の別解?
#.NETのSyndicationFeedクラスを使ってやってみました。
[System.Reflection.Assembly]::LoadWithPartialName("System.ServiceModel.dll")
$url = "http://winscript.jp/powershell/rss2/"
$xml = [System.Xml.XmlReader]::Create($url)
$feed = [System.ServiceModel.Syndication.SyndicationFeed]::Load($xml)
foreach($item in $feed.Items)
{
$item.title.Text
}
@kiyokura
kiyokura / VbReport70WebSample.vb
Created March 21, 2012 02:51
VB-Report7.0のXlsx.Web.XlsxWebReportのミニマムコードメモ
'----------------------------
' .Net 4版。
' 以下の参照設定が必要
' VBReport7.Document.4
' VBReport7.Xlsx.IO.4
' VBReport7.Xlsx.Web.Report.4
'----------------------------
Imports AdvanceSoftware.VBReport7
Class ExcelWebDonwloadSample