Jira (BOLT-406) WinRM connector should make ConvertTo-Json / ConvertFrom-Json available in PS2

2019-03-11 Thread David Kramer (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 David Kramer updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet Task Runner /  BOLT-406  
 
 
  WinRM connector should make ConvertTo-Json / ConvertFrom-Json available in PS2   
 

  
 
 
 
 

 
Change By: 
 David Kramer  
 
 
Team: 
 Dumpling  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





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


Jira (BOLT-406) WinRM connector should make ConvertTo-Json / ConvertFrom-Json available in PS2

2018-03-21 Thread Ethan Brown (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ethan Brown commented on  BOLT-406  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: WinRM connector should make ConvertTo-Json / ConvertFrom-Json available in PS2   
 

  
 
 
 
 

 
 I would generally advocate for doing the simple thing here that solves this specific problem, as this would primarily involve sharing code with users that is already used / implemented in Bolt / pxp-agent (for the very same reason - JSON support in PS2).   For sure the generic reusable code idea has merit, but it's also a lot more work / effort to implement than I think is needed for this one narrowly scoped scenario.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





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


Jira (BOLT-406) WinRM connector should make ConvertTo-Json / ConvertFrom-Json available in PS2

2018-03-21 Thread Ethan Brown (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ethan Brown updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet Task Runner /  BOLT-406  
 
 
  WinRM connector should make ConvertTo-Json / ConvertFrom-Json available in PS2   
 

  
 
 
 
 

 
Change By: 
 Ethan Brown  
 

  
 
 
 
 

 
 Since it is common to want to return JSON data from tasks, and since it can be problematic to build inline JSON given escaping / formatting rules, there should be a facility always available for task authors to produce JSON from PowerShell. Normally this can be done using PowerShell 3 and above using the  [ConvertTo-Json|https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertto-json?view=powershell-3.0] and [ConvertFrom-Json|https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertfrom-json?view=powershell-3.0] cmdlets.  However, Bolt and PE tasks explicitly support PS2+ so for PS2, a polyfill is necessary to make these cmdlets available.  Bolt code already does something similar for its own purposes at [https://github.com/puppetlabs/bolt/blob/a53f2f872a82b2a5ba6a4d8961243f2cb7c1ce1f/lib/bolt/transport/winrm/connection.rb#L205-L380] as does the implementation of PE tasks  at [https://github . com/puppetlabs/pxp-agent/blob/33a76e0080e61b353dff9fbf17e4dbede44bd09b/exe/PowershellShim-Helper.ps1]   .   These facilities just need to be surfaced to end users. Otherwise, if users wish to write PowerShell tasks that support all PowerShell versions, they must build inline JSON strings.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
   

Jira (BOLT-406) WinRM connector should make ConvertTo-Json / ConvertFrom-Json available in PS2

2018-03-21 Thread Alex Dreyer (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alex Dreyer commented on  BOLT-406  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: WinRM connector should make ConvertTo-Json / ConvertFrom-Json available in PS2   
 

  
 
 
 
 

 
 If we build this into bolt it needs to be part of the task spec first. Tasks that rely on this will be degraded when run by older task runners. I have some questions about whether problems like this should be solved as one offs for every language or if we should focus on BOLT-133 to add general handling of boilerplate code to the task spec.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





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


Jira (BOLT-406) WinRM connector should make ConvertTo-Json / ConvertFrom-Json available in PS2

2018-03-21 Thread Ethan Brown (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ethan Brown created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet Task Runner /  BOLT-406  
 
 
  WinRM connector should make ConvertTo-Json / ConvertFrom-Json available in PS2   
 

  
 
 
 
 

 
Issue Type: 
  New Feature  
 
 
Affects Versions: 
 BOLT 0.17.0  
 
 
Assignee: 
 Unassigned  
 
 
Components: 
 WinRM  
 
 
Created: 
 2018/03/21 10:29 AM  
 
 
Priority: 
  Normal  
 
 
Reporter: 
 Ethan Brown  
 

  
 
 
 
 

 
 Since it is common to want to return JSON data from tasks, and since it can be problematic to build inline JSON given escaping / formatting rules, there should be a facility always available for task authors to produce JSON from PowerShell.   Normally this can be done using PowerShell 3 and above using the  ConvertTo-Json and ConvertFrom-Json cmdlets.  However, Bolt and PE tasks explicitly support PS2+ so for PS2, a polyfill is necessary to make these cmdlets available.  Bolt code already does something similar for its own purposes at https://github.com/puppetlabs/bolt/blob/a53f2f872a82b2a5ba6a4d8961243f2cb7c1ce1f/lib/bolt/transport/winrm/connection.rb#L205-L380 as does the implementation of PE tasks.  These facilities just need to be surfaced to end users.   Otherwise, if users wish to write PowerShell tasks that support all PowerShell versions, they must build inline JSON strings.