[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-11-13 Thread edgars.didrihs...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Edgars Didrihsons commented on  JENKINS-50840  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
 How is this Fixed when I still encounter it today with Jenkins 2.138.3 and durable-task-plugin 1.27 ? Adding Out-String does help though so thanks for that.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-09-03 Thread g...@3ds.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 g hs1 closed an issue as Fixed  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-50840  
 
 
  Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
Change By: 
 g hs1  
 
 
Status: 
 Resolved Closed  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-05-17 Thread g...@3ds.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 g hs1 resolved as Fixed  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Thank you for your help and for investigating the problem. I'm not set up for Maven so I have applied your workaround and the script is now working.  
 

  
 
 
 
 

 
 Jenkins /  JENKINS-50840  
 
 
  Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
Change By: 
 g hs1  
 
 
Status: 
 Open Resolved  
 
 
Resolution: 
 Fixed  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 

[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-05-16 Thread gab...@microsoft.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Loewen commented on  JENKINS-50840  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
 The problematic line of code is this one:   

 

Get-VM -Server $vc -Name $svr | Get-Snapshot | Select VM, Created, Name, SizeMB | FT
 

 Here, FT is an alias for Format-Table, which is what is causing the exception to be thrown. Without taking my fix you could modify that line slightly:     

 

Get-VM -Server $vc -Name $svr | Get-Snapshot | Select VM, Created, Name, SizeMB | FT | Out-String
 

 Which should get past the issue. If you want to build and use my latest bits you can always checkout my repo and build it using Maven, and then install the HPI file in your Jenkins instance.    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit 

[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-05-16 Thread gab...@microsoft.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Loewen edited a comment on  JENKINS-50840  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
 The problematic line of code is this one:   {code:java}Get-VM -Server $vc -Name $svr | Get-Snapshot | Select VM, Created, Name, SizeMB | FT{code}Here, *FT* is an alias for *Format-Table*, which is what is causing the exception to be thrown. Without taking my fix you could modify that line slightly:    {code:java}Get-VM -Server $vc -Name $svr | Get-Snapshot | Select VM, Created, Name, SizeMB | FT | Out-String{code}Which should get past the issue. If you want to build and use my latest bits you can always checkout my repo and build it using Maven, and then install the HPI file in your Jenkins instance.   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-05-16 Thread g...@3ds.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 g hs1 commented on  JENKINS-50840  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
 Thank you. It doesn't appear so. Here's the script: 

 

Param (
    [Alias("Host")]
    [string]$VIServer = "***",
    [string]$vmname = "***",
    [string]$admin = "***",
    [string]$pathToCredentials
)

#You must change these values to securely save your credential files
$key = ***

Function Get-Credentials {
    Param (
    [String]$authUser = $env:USERNAME,
    [string]$pathToCred
    )

    #Build the path to the credential file
    $credFile = $authUser.Replace("\","~")
    If (-not $pathToCred){
    $pathToCred = Split-Path $MyInvocation.MyCommand.Path
    }
    $file = Join-Path -Path $pathToCred -ChildPath "\Credentials-$credFile.crd"
    #And find out if it's there, if not create it
    If(-not (Test-Path $file)){
        (Get-Credential $authUser).Password | ConvertFrom-SecureString -Key $key | Set-Content $file
    }
    #Load the credential file
    $password = Get-Content $file | ConvertTo-SecureString -Key $key
    $authUser = (Split-Path $file -Leaf).Substring(12).Replace("~","\")
    $authUser = $authUser.Substring(0,$authUser.Length - 4)
    $credential = New-Object System.Management.Automation.PsCredential($authUser,$password)
    Return $credential
}

If(-not $pathToCredentials){
    $pathToCredentials = Split-Path $MyInvocation.MyCommand.Path
}

Clear-Host

$svr = "***"
$snapshot = "***"
$cred = Get-Credentials $admin $pathToCredentials
Try{
    Write-Output "Connecting to vSphere server..."
    $vc = Connect-VIServer $VIServer -Credential $cred -ErrorAction Stop 3>$null
    Get-VM -Server $vc -Name $svr | Get-Snapshot | Select VM, Created, Name, SizeMB | FT
    Write-Output "Restoring snapshot..."
    $vm = Get-VM -Server $vc -Name $vmname
    $snapshot = Get-Snapshot -VM $vm -Name $snapshot
    Set-VM -VM $vm -Snapshot $snapshot -Confirm:$false
}
Catch{
    Throw "Error connecting to $VIServer because ""$($Error[1])"""
}
# Exit with 0 unless an exception is thrown.
# Prevents returned values greater than 1 failing the build unnecessarily.
exit 0
 

 It uses VMware's PowerCLI to restore a VM from a snapshot. Is there any way I can test your fix without waiting weeks or months for a release? Thanks.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-05-15 Thread gab...@microsoft.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Loewen edited a comment on  JENKINS-50840  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
 This edge case seems to be happening only with powershell format cmdlets, such as Format-Table, etc...  Are you using one of these cmdlets?  You can fix it temporarily by piping any calls to  Foramt  Format -* cmdlets to Out-String:e.g.{code:java}$Data | Format-Table | Out-String{code}Meanwhile, it should be fixed in my PR: [https://github.com/jenkinsci/durable-task-plugin/pull/70]   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-05-15 Thread gab...@microsoft.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Loewen edited a comment on  JENKINS-50840  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
 This edge case seems to be happening only with powershell format cmdlets, such as Format-Table, etc...  Are you using one of these cmdlets?  You can fix it temporarily by piping any calls to Foramt-* cmdlets to Out-String:e.g.   {code:java}$Data | Format-Table | Out-String{code}Meanwhile, it should be fixed in my PR:  [ https://github.com/jenkinsci/durable-task-plugin/pull/70 ]    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-05-15 Thread gab...@microsoft.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Loewen commented on  JENKINS-50840  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
 This edge case seems to be happening only with powershell format cmdlets, such as Format-Table, etc...  Are you using one of these cmdlets?  You can fix it temporarily by piping any calls to Foramt-* cmdlets to Out-String: e.g.   

 

$Data | Format-Table | Out-String 

 Meanwhile, it should be fixed in my PR: https://github.com/jenkinsci/durable-task-plugin/pull/70    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-05-14 Thread gab...@microsoft.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Loewen commented on  JENKINS-50840  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
 It looks like this is an edge case that is triggered when streaming console output from a powershell script cannot be interpreted as serializable data.  I will work on a fix for this.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-05-14 Thread gab...@microsoft.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Loewen assigned an issue to Gabriel Loewen  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-50840  
 
 
  Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
Change By: 
 Gabriel Loewen  
 
 
Assignee: 
 Gabriel Loewen  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-04-17 Thread g...@3ds.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 g hs1 edited a comment on  JENKINS-50840  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
 Note that the  PowerShell  script itself still runs correctly outside of Jenkins.  There are no spaces in the job name (JENKINS-48415)  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-04-17 Thread g...@3ds.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 g hs1 commented on  JENKINS-50840  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
 Note that the script itself still runs correctly outside of Jenkins.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-04-17 Thread g...@3ds.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 g hs1 updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-50840  
 
 
  Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
Change By: 
 g hs1  
 

  
 
 
 
 

 
 Powershell script execution is broken, possibly after upgrading to durable task  pluin  plugin  1.22.{code:java}11:15:08 out-lineoutput : Object reference not set to an instance of an object.11:15:08 At C:\Builds\home\workspace\INTG_Lab_Installation_Script_Test\workspace@tmp\durable-19f0c27a\powershellHelper.ps1:25 char:711:15:08 +   $Input | Out-String -Stream -Width 192 | ForEach-Object { $Writer.WriteLin ...11:15:08 + 11:15:08 + CategoryInfo  : NotSpecified: (:) [out-lineoutput], NullReferenceException11:15:08 + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.OutLineOutputCommand11:15:08  {code}Reverting to 1.17 broke everything{code}Running in Durability level: MAX_SURVIVABILITY[Pipeline] End of Pipelinejava.lang.NoSuchMethodError: No such DSL method 'node' found among steps [addBadge, addErrorBadge, addHtmlBadge, addInfoBadge, addShortText, addWarningBadge, ansiColor, archive, build, catchError, checkout, createSummary, deleteDir, dir, echo, error, fileExists, getContext, git, input, isUnix, jiraComment, jiraIssueSelector, jiraSearch, junit, library, libraryResource, load, mail, milestone, p4, p4approve, p4publish, p4sync, p4tag, p4unshelve, parallel, properties, publishHTML, pwd, readFile, readTrusted, removeBadges, removeHtmlBadges, removeSummaries, resolveScm, retry, sleep, stage, stash, step, svn, timeout, timestamps, tm, tool, unarchive, unstash, waitUntil, withContext, withCredentials, withEnv, wrap, writeFile] or symbols [absolute, agent, all, always, ant, antFromApache, antOutcome, antTarget, apiToken, approve, architecture, archiveArtifacts, artifactManager, authorizationMatrix, autoClean, batchFile, bitbucket, booleanParam, buildButton, buildDiscarder, bzt, caseInsensitive, caseSensitive, certificate, checkstyle, choice, choiceParam, ciGame, cleanup, clientSpec, clock, cloud, command, credentials, cron, crumb, defaultView, demand, depotSource, disableConcurrentBuilds, disableResume, dockerCert, downloadSettings, downstream, dumb, durabilityHint, envVars, file, fileCopyOperation, fileCreateOperation, fileDeleteOperation, fileDownloadOperation, fileJoinOperation, fileOperations, fileParam, filePath, filePropertiesToJsonOperation, fileRenameOperation, fileTransformOperation, fileUnTarOperation, fileUnZipOperation, fileZipOperation, fingerprint, fishEye, flushOnly, folderCopyOperation, folderCreateOperation, folderDeleteOperation, folderRenameOperation, forceClean, frameOptions, freeStyle, freeStyleJob, fromScm, fromSource, git, github, githubPush, globalLib, gradle, graphClean, graphSource, headRegexFilter, headWildcardFilter, hyperlink, hyperlinkToModels, incremental, inheriting, inheritingGlobal, installSource, jdk, jdkInstaller, jgit, jgitapache, jnlp, jobName, label, lastDuration, lastFailure, 

[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1

2018-04-17 Thread g...@3ds.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 g hs1 created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-50840  
 
 
  Powershell script execution broken in powershellHelper.ps1   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Unassigned  
 
 
Components: 
 durable-task-plugin  
 
 
Created: 
 2018-04-17 10:30  
 
 
Environment: 
 Win2008R2 master, Win2016 agent. Jenkins 2.117 and earlier.  
 
 
Priority: 
  Major  
 
 
Reporter: 
 g hs1  
 

  
 
 
 
 

 
 Powershell script execution is broken, possibly after upgrading to durable task pluin 1.22. 

 

11:15:08 out-lineoutput : Object reference not set to an instance of an object.
11:15:08 At C:\Builds\home\workspace\INTG_Lab_Installation_Script_Test\workspace@tmp\durable-19f0c27a\powershellHelper.ps1:25 char:7
11:15:08 +   $Input | Out-String -Stream -Width 192 | ForEach-Object { $Writer.WriteLin ...
11:15:08 + 
11:15:08 + CategoryInfo  : NotSpecified: (:) [out-lineoutput], NullReferenceException
11:15:08 + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.OutLineOutputCommand
11:15:08   

 Reverting to 1.17 broke everything 

 

Running in Durability level: MAX_SURVIVABILITY
[Pipeline] End of Pipeline
java.lang.NoSuchMethodError: No such DSL method 'node' found among steps [addBadge, addErrorBadge, addHtmlBadge, addInfoBadge, addShortText,