Code Formatting Testing

Home Forums Web Site Feedback & Assistance Code Formatting Testing

You must be registered and logged in to reply to this topic.

This topic contains 5 replies, has 1 voice, and was last updated by  Don Jones 2 years ago.

  • #6611

    Don Jones
    Keymaster

    In an effort to try and improve the code formatter, I'm using this thread to test samples folks send me. If you choose to post here, it'd help if I knew what browser you were trying to use, and if you pasted a plain-text (unformatted) copy of your script.

    $tableAsString = $disks | ft @{Name=’Drive’;Expression={$_.DeviceId}},@{Name=’Size(GB)’;Expression={‘{0:N2}’ -f ($_.Size / 1GB)}} -AutoSize | Out-String

    $tableAsString -replace ‘^\s+|\s+$’ -split “rn|r|n” | Select-Object -Skip 2

    $tableAsString = $disks | ft @{Name=’Drive’;Expression={$_.DeviceId}},@{Name=’Size(GB)’;Expression={‘{0:N2}’ -f ($_.Size / 1GB)}} -AutoSize | Out-String
    
    $tableAsString -replace ‘^\s+|\s+$’ -split “rn|r|n” | Select-Object -Skip 2

     

    Don Jones
    Curriculum Director for IT Pro Content, Pluralsight.com

  • #6777

    Don Jones
    Keymaster

    This is text

    Write-Host "This is rn code"

    Get-Service `

    $services[0].that

    [string[]]

     

    Don Jones
    Curriculum Director for IT Pro Content, Pluralsight.com

    #6787

    Don Jones
    Keymaster
    Write-Host "This `n is code"
    Get-Service `
    $services[0].that
    [string[]]
    

    Don Jones
    Curriculum Director for IT Pro Content, Pluralsight.com

    #6788

    Don Jones
    Keymaster

    [sourcecode language="powershell"]

    Write-Host "This `n is code"
    Get-Service `
    $services[0].that
    [string[]]

    [/sourcecode]

    Don Jones
    Curriculum Director for IT Pro Content, Pluralsight.com

    #6789

    Don Jones
    Keymaster

    [sourcecode language=powershell]

    backtick `
    back`tick`
    nothing

    [/sourcecode]

    Don Jones
    Curriculum Director for IT Pro Content, Pluralsight.com

    #6790

    Don Jones
    Keymaster
    Get-Host "back`tick`y"
    Do-Those
    Then-These `
    Or-That

     

    Don Jones
    Curriculum Director for IT Pro Content, Pluralsight.com

You must be registered and logged in to reply to this topic.