-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartNode.ps1
More file actions
31 lines (24 loc) · 1.1 KB
/
startNode.ps1
File metadata and controls
31 lines (24 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
param(
$port = 5555,
[string]$hubHost = "127.0.0.1",
$hubPort = 4444,
$toolsUrl = "https://github.com/saipuli/selenium-node/archive/master.zip"
)
$downloadsFolder = "$env:USERPROFILE\Downloads"
$workingFolder = "$downloadsFolder\selenium-node-master"
Write-Host "Remove the folder with old stuff"
Remove-Item $workingFolder -Recurse -Force -ErrorAction SilentlyContinue
Write-Host "Download new stuffs to $env:USERPROFILE\Downloads folder"
# Download the file to a specific location
$wc = new-object System.Net.WebClient
$downloadFileName = "$downloadsFolder\selenium-node-master.zip"
$wc.DownloadFile($toolsUrl,$downloadFileName)
Write-Host "Download completed, unzipping contents"
# Unzip the file to specified location
$shell_app=new-object -com shell.application
$zipFile = $shell_app.namespace($downloadFileName)
$destination = $shell_app.namespace($downloadsFolder)
$destination.Copyhere($zipFile.items())
Remove-Item "$downloadsFolder\selenium-node-master.zip" -Force -ErrorAction Ignore
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
Invoke-Expression $workingFolder\startup.ps1