Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Users/pragupta/azurepwrshelltask #3175

Merged
merged 3 commits into from
Dec 5, 2016

Conversation

pragupta-ms
Copy link
Contributor

No description provided.

$scriptPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), $tempFileName);
($scriptInline | Out-File $scriptPath)

Write-Host "tempFile= $scriptPath"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add localized string here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like debug messaging to me. consider the write-verbose instead.

@@ -2,13 +2,17 @@ Trace-VstsEnteringInvocation $MyInvocation
Import-VstsLocStrings "$PSScriptRoot\Task.json"

# Get inputs.
$scriptPath = Get-VstsInput -Name ScriptPath -Require
$scriptType = Get-VstsInput -Name ScriptType -Require
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when script type is filepath, then shouldn't ScriptPath be required? i.e. Get-VstsInput -Name ScriptPath -Require

similar thing for inline scenario

If ($scriptType -eq "InlineScript") {
$tempFileName = [guid]::NewGuid().ToString() + ".ps1";
$scriptPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), $tempFileName);
($scriptInline | Out-File $scriptPath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should try/finally and best-effort cleanup this temp file. here is what the agent does for the powershell task. it creates a warning issue if the file fails to delete for some reason.

"visibleRule": "ScriptType = FilePath"
},
{
"name": "AzurePowerShellInline",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, "AzurePowerShell" in the input name seems redunant. it's the Azure PowerShell task.

"helpMarkDown": "Type of the script: File Path or Inline Script",
"defaultValue": "FilePath",
"options": {
"FilePath": "AzurePowerShell Script File Path",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, "AzurePowerShell" in the dropdown items seems redundant to me. it's the Azure PowerShell task, so this is implied already.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...nit continued :)

also, i would even say having "AzurePowerShell" in the dropdown item text may be confusing. the task initializes the Azure module and then runs the PowerShell script. other than the name of the task, there is no such thing as "Azure PowerShell"

@ericsciple
Copy link
Contributor

i believe @kmkumaran 's team owns this task. i'm happy to provide a review, but signoff should come from the owners of this task.

@ericsciple
Copy link
Contributor

nit, also i noticed the commits contains a merge commit. rebase is nicer for viewing history. sometimes merges are convenient, but for a small changes generally rebase is better

@kmkumaran
Copy link
Member

@ericsciple - sure. My team will own the final sign-off for this task.

Copy link
Member

@kmkumaran kmkumaran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave a comment

@pragupta-ms pragupta-ms merged commit d923fb1 into master Dec 5, 2016
@pragupta-ms pragupta-ms deleted the users/pragupta/azurepwrshelltask branch December 5, 2016 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants