Skip to content
This repository was archived by the owner on Jun 29, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@ InstallAnacondaAndPythonDependencies
if ((Get-WMIObject win32_service | Where-Object {$_.name -eq "nodemanager"}))
{
Restart-Service nodemanager;
}
}


# Log that this script was run so we have usage numbers.
$web_client.DownloadString("http://pageviews.azurewebsites.net/pageview?Azure_HDI_Setup_Windows.ps1") | Out-Null
42 changes: 42 additions & 0 deletions Misc/MachineSetup/Azure_VM_CustomScript_Windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
################################################################################
# Copyright (c) Microsoft. All rights reserved.
#
# Apache 2.0 License
#
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
#
################################################################################
param(
[string]$AccountName = $(throw "-AccountName is required."),
[string]$AccountPassword = $(throw "-AccountPassword is required."),
[string]$IPythonPassword = $(throw "-IPythonPassword is required.")
)

echo "Starting CustomScript process using the following parameters:"
echo "AccountName:$AccountName"
echo "AccountPassword:$AccountPassword"
echo "IPythonPassword:$IPythonPassword"

# Download the AzureML Windows setup script
$web_client = new-object System.Net.WebClient
$url="https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/MachineSetup/Azure_VM_Setup_Windows.ps1"
$ps1Path = [IO.Path]::GetTempFileName() + ".ps1"
$web_client.DownloadFile($url, $ps1Path)

# Run the setup script as the account user
$SecureAccountPassword = ConvertTo-SecureString $AccountPassword -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential("${env:COMPUTERNAME}\${AccountName}", $SecureAccountPassword)
Enable-PSRemoting -Force
Invoke-Command -FilePath $ps1Path -Credential $credential -ComputerName $env:COMPUTERNAME -ArgumentList $AccountPassword, $IPythonPassword
Disable-PSRemoting -Force
echo "Ending CustomScript process"

# Log that this script was run so we have usage numbers.
$web_client.DownloadString("http://pageviews.azurewebsites.net/pageview?Azure_VM_CustomScript_Windows.ps1") | Out-Null
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,8 @@ InstallAnacondaAndPythonDependencies
GetSampleNotebooksFromGit
SetupIPythonNotebookService # Make sure this is last in the script as this start IPython Notebook Service
StartIPythonNotebookService

# Log that this script was run so we have usage numbers.
curl -o /dev/null "http://pageviews.azurewebsites.net/pageview?Azure_VM_Setup_Ubuntu.sh"

cd $prev_dir
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,7 @@ SetupIPythonNotebookService
ScheduleAndStartIPython
SetupSQLServerAccess

# Log that this script was run so we have usage numbers.
$web_client.DownloadString("http://pageviews.azurewebsites.net/pageview?Azure_VM_Setup_Windows.ps1") | Out-Null

cd $previous_pwd
298 changes: 0 additions & 298 deletions Misc/MachineSetup/rbaAzureML_WindowsSetup.ps1

This file was deleted.