Skip to content

Example code should not start with 'PS C:\>' #264

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

Closed
juanpablojofre opened this issue Mar 9, 2017 · 4 comments
Closed

Example code should not start with 'PS C:\>' #264

juanpablojofre opened this issue Mar 9, 2017 · 4 comments
Labels
Area-MarkdownWriter Issue concerns conversion to markdown
Milestone

Comments

@juanpablojofre
Copy link

juanpablojofre commented Mar 9, 2017

Steps to reproduce

function Get-HashValueFromString {
  [CmdletBinding()]
  Param (
    [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [String] $string
    ,  [parameter(Mandatory=$false)] 
       [ValidateSet("SHA1", "SHA256", "SHA384", "SHA512", "MACTripleDES", "MD5", "RIPEMD160")] 
       [String] $algorithm = "SHA256"
  )

  END{
    [byte[]]$testbytes = [System.Text.UnicodeEncoding]::Unicode.GetBytes($string)

    [System.IO.Stream]$memorystream = [System.IO.MemoryStream]::new($testbytes)
    $hashfromstream = Get-FileHash -InputStream $memorystream -Algorithm $algorithm
    $hashfromstream.Hash.ToString()  
  }
}

New-MarkdownHelp -Command Get-HashValueFromString -OutputFolder C:\tmp

Expected behavior

EXAMPLES

Example 1

{{ Add example code here }}

{{ Add example description here }}

Actual behavior

EXAMPLES

Example 1

PS C:\> {{ Add example code here }}

{{ Add example description here }}

Environment data

v0.5.0

@vors
Copy link
Collaborator

vors commented May 15, 2017

There are 2 types of example codesnippets:

  • Code (when we use powershell moniker after triple-ticks)
  • Interactive console log (we we dont)

In the former case, we should not, in the later case we should.

@vors
Copy link
Collaborator

vors commented Jun 4, 2017

Related discussion #131

@BernieWhite
Copy link
Contributor

Related to #294

@sdwheeler
Copy link
Collaborator

This is fixed in Microsoft.PowerShell.PlatyPS v1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-MarkdownWriter Issue concerns conversion to markdown
Projects
None yet
Development

No branches or pull requests

5 participants