PowerShell Memo
PowerShell Memo  
 



PowerShell Memo

 
















My profile.ps12


PowerShell  


System.Windows.Forms


New-WindowsControl

#############################################################
# 関数名 Load-WindowsForms
# 概要 System.Windows.Formsアセンブリを読み込む
# 内容
#
# エイリアス lwf
#############################################################
function Load-WindowsForms
{
$ret = Get-Assemblies |
?{$_.ManifestModule.Name -eq "System.Windows.Forms.dll"}
if($ret -eq $null)
{
[Void][Reflection.Assembly]::LoadWithPartialName(
"System.Windows.Forms")
}
}
Set-Alias lwf Load-WindowsForms



Windows


1Jeffrey Snover

#############################################################
# 関数名 New-WindowsControl
# 概要 Windowsコントロールを生成する
# 内容
#
# エイリアス control
#############################################################
function New-WindowsControl
([String]$controlName, [hashtable]$property=@{})
{
Load-WindowsForms
$control = New-Object System.Windows.Forms.$controlName
foreach ($key in $property.Keys)
{
$control.$key = $property.$key
}
return $control
}
Set-Alias control New-WindowsControl



使


Form


$form = control Form @{Text="Form"; Opacity=0.75}
Formfo
rm


Button

Dock

$button =
control Button @{Text="Click!"; Dock="Fill";Font="Arial,30,style=Bold"}
Butto
nbutton




$form = control Form @{Text="Form"; Opacity=0.75}
$button =
control Button @{Text="Click!"; Dock="Fill";Font="Arial,30,style=Bold"}
$form.Controls.Add($button)
$form.ShowDialog()



 




newpops      










 






 









 

id:newpops id:newpops  
       


 




 





 



 

 

 

Pro  





 




 



 



83  



72  



61  






 




   
2011  

2011 / 12  




   
2010  

2010 / 9  




   
2008  

2008 / 5  

2008 / 4  




   
2007  

2007 / 11  

2007 / 8  

2007 / 7  

2007 / 6  

2007 / 4  

2007 / 3  

2007 / 2  

2007 / 1  




   
2006  

2006 / 12  

2006 / 11  

2006 / 10  

2006 / 9  

2006 / 8  

2006 / 7  

2006 / 6  

2006 / 5  

2006 / 4  

2006 / 3  

2006 / 2  

2006 / 1  




   
2005  

2005 / 12  

2005 / 11  

2005 / 10  

2005 / 9  

2005 / 8  













newpops使


 

 




PowerShell Memo PowerShell Memo  

Powered by Hatena Blog  |