「[[マイクロソフト系技術情報 Wiki>http://techinfoofmicrosofttech.osscons.jp/]]」は、「[[Open棟梁Project>https://github.com/OpenTouryoProject/]]」,「[[OSSコンソーシアム .NET開発基盤部会>https://www.osscons.jp/dotNetDevelopmentInfrastructure/]]」によって運営されています。 -[[戻る>PowerShell]] * 目次 [#j809f979] #contents * 概要 [#tf343219] cmdlet は自分で作成できます。 *PowerShell [#h72b9cdf] -PowerShell で cmdlet が作れます。 -PowerShell で作る場合は、PowerShellの関数を作成して、.psm1 ファイルに保存します。 -使用するときは、「import-module .psm1ファイルのフルパス」で読み込むと、関数を使用できます。 -psm1 の中では、既定では、全ての関数が使用できますが、~ .psm1ファイルの内部関数を定義して、一部の関数のみ、使用可能とする場合には、 --使用可能にする関数名を「Export-ModuleMember -function 関数名」の様にして列挙します。 --こうすると、Export-ModuleMember に指定されなかった関数が、内部関数とみなされます。 *System.Management.Automation.PSCmdlet [#w3970a37] -C# で cmdlet を開発することも出来ます。 -System.Management.Automation.PSCmdlet クラスから派生するクラスを作成します。 *参考 [#qa4469d8] -PowerShell Cmdlet Design Guidelines · Azure/azure-powershell Wiki~ https://github.com/Azure/azure-powershell/wiki/PowerShell-Cmdlet-Design-Guidelines **PowerShell [#cd78119a] -Windows PowerShell: スクリプトを簡単に共有できるようになりました~ http://technet.microsoft.com/ja-jp/magazine/ff625835.aspx -Windows PowerShell: スクリプトでコマンドレットを記述する~ http://technet.microsoft.com/ja-jp/magazine/ff677563.aspx -Windows PowerShell: Writing Cmdlets in Script~ http://technet.microsoft.com/en-us/magazine/ff677563.aspx **System.Management.Automation.PSCmdlet [#c53a8e6b] -Windows PowerShell コマンドレットの作成~ http://msdn.microsoft.com/ja-jp/events/dd297528.aspx~ -Developing with Windows PowerShell~ http://msdn.microsoft.com/en-us/library/cc303698.aspx~ -C#と諸々 コマンドレットの作成方法~ http://csharper.blog57.fc2.com/blog-entry-55.html -PowerShell Cmdlet を人道的に使いたいから頑張ってみるお話 - tech.guitarrapc.cóm~ http://tech.guitarrapc.com/entry/2015/12/25/233000 ---- Tags: [[:シェル]], [[:インフラストラクチャ]], [[:Windows]]