[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $Form = New-Object System.Windows.Forms.Form $Form.Size = New-Object System.Drawing.Size(600,400) ############################################## Start functions function s3Info { $s3Result= aws s3 ls | fl | out-string; $outputBox.text=$s3Result } #end s3Info ############################################## end functions ############################################## Start text fields $outputBox = New-Object System.Windows.Forms.TextBox $outputBox.Location = New-Object System.Drawing.Size(10,150) $outputBox.Size = New-Object System.Drawing.Size(565,200) $outputBox.MultiLine = $True $outputBox.ScrollBars = "Vertical" $Form.Controls.Add($outputBox) ############################################## end text fields ############################################## Start buttons $Button = New-Object System.Windows.Forms.Button $Button.Location = New-Object System.Drawing.Size(400,30) $Button.Size = New-Object System.Drawing.Size(110,80) $Button.Text = "Ping" $Button.Add_Click({s3Info}) $Form.Controls.Add($Button) ############################################## end buttons $Form.Add_Shown({$Form.Activate()}) [void] $Form.ShowDialog()
$Form.Add_Load({s3Info})
$Form.Add_Shown(...)
$Button
$S3Result=ping $S3Path $Local | fl | out-string;
$S3Result=ping $S3Bucket $Local | fl | out-string;
$S3Bucket
$S3Path
using System; static class Program { static void Main(string[] args) { for (int i = 0; i < args.Length; i++) { Console.WriteLine("{0}> {1}", i, args[i]); } } }
3Result=ping $S3Path $Local
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)