diff --git a/Remote-InstallPerfTap.ps1 b/Remote-InstallPerfTap.ps1 new file mode 100644 index 0000000..092a9b6 Binary files /dev/null and b/Remote-InstallPerfTap.ps1 differ diff --git a/src/Installation/LaunchRemoteInstall.ps1 b/src/Installation/LaunchRemoteInstall.ps1 new file mode 100644 index 0000000..accb70d --- /dev/null +++ b/src/Installation/LaunchRemoteInstall.ps1 @@ -0,0 +1,64 @@ +param( + [string] + [Parameter(Position=0,ValueFromPipeLine=$true)] + $MachineIP, + [string] + [Parameter(Position=1,ValueFromPipeLine=$true)] + $UserName, + [string] + [Parameter(Position=2,ValueFromPipeLine=$true)] + $Password, + [string] + [Parameter(Position=3,ValueFromPipeLine=$true)] + $Key, + [string] + [Parameter(Position=4,ValueFromPipeLine=$true)] + $Server, + [int] + [Parameter(Position=5,ValueFromPipeLine=$true)] + $SecondFrequency, + [string] + [Parameter(Position=6,ValueFromPipeLine=$true)] + $FilePath, + [Array] + [Parameter(Position=7,ValueFromPipeLine=$true)] + $Counters + ) + +Function GetFiles +{ + param( + [string] + [Parameter(Mandatory=$true)] + $filePath + ) + + $files=@{} + If (Test-Path $filePath) + { + Get-ChildItem $filePath | % {$files.Add($_.Name , (Get-Content $_.FullName)) } + return $files + } + else + { + Write-Host "File does not exist" + } +} + +GetFiles $FilePath + +$params = @{ + FilePath = Join-Path (Split-Path ($MyInvocation.Command.Path) "remoteinstall.ps1"); + ArgumentList = @($Key,$Server,$SecondFrequency,$Counters,(GetFiles $FilePath),$UserName,$Password); + ComputerName = $MachineIP; + Credential = (New-Object System.Management.Automation.PsCredential($UserName,(ConvertTo-SecureString $Password -AsPlainText -force))) + } + + Invoke-Command @params + + + + + + + \ No newline at end of file diff --git a/src/Installation/LaunchRemoteInstall2.ps1 b/src/Installation/LaunchRemoteInstall2.ps1 new file mode 100644 index 0000000..accb70d --- /dev/null +++ b/src/Installation/LaunchRemoteInstall2.ps1 @@ -0,0 +1,64 @@ +param( + [string] + [Parameter(Position=0,ValueFromPipeLine=$true)] + $MachineIP, + [string] + [Parameter(Position=1,ValueFromPipeLine=$true)] + $UserName, + [string] + [Parameter(Position=2,ValueFromPipeLine=$true)] + $Password, + [string] + [Parameter(Position=3,ValueFromPipeLine=$true)] + $Key, + [string] + [Parameter(Position=4,ValueFromPipeLine=$true)] + $Server, + [int] + [Parameter(Position=5,ValueFromPipeLine=$true)] + $SecondFrequency, + [string] + [Parameter(Position=6,ValueFromPipeLine=$true)] + $FilePath, + [Array] + [Parameter(Position=7,ValueFromPipeLine=$true)] + $Counters + ) + +Function GetFiles +{ + param( + [string] + [Parameter(Mandatory=$true)] + $filePath + ) + + $files=@{} + If (Test-Path $filePath) + { + Get-ChildItem $filePath | % {$files.Add($_.Name , (Get-Content $_.FullName)) } + return $files + } + else + { + Write-Host "File does not exist" + } +} + +GetFiles $FilePath + +$params = @{ + FilePath = Join-Path (Split-Path ($MyInvocation.Command.Path) "remoteinstall.ps1"); + ArgumentList = @($Key,$Server,$SecondFrequency,$Counters,(GetFiles $FilePath),$UserName,$Password); + ComputerName = $MachineIP; + Credential = (New-Object System.Management.Automation.PsCredential($UserName,(ConvertTo-SecureString $Password -AsPlainText -force))) + } + + Invoke-Command @params + + + + + + + \ No newline at end of file