-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversation
$scriptPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), $tempFileName); | ||
($scriptInline | Out-File $scriptPath) | ||
|
||
Write-Host "tempFile= $scriptPath" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add localized string here.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
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. |
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 |
@ericsciple - sure. My team will own the final sign-off for this task. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave a comment
No description provided.