Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 1.04 KB

Here-Strings.md

File metadata and controls

18 lines (14 loc) · 1.04 KB

Here-strings

What Is It

A here-string is a single-quoted or double-quoted string surrounded by at signs (@). Quotation marks within a here-string are interpreted literally.

- from https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules#here-strings

When To Use

  • useful for some in-line string that may have quotes within it, and for multi-line string
    • HTML output template
  • have seen in some inception coding / meta-programming (if ever doing so; good for haX0rs)
    • SSL Config .ini file for generating new CSR
    • for creating "input" files used by other binaries like nslookup.exe (for use cases that cmdlets do not yet cover)

When Not To Use

  • mostly, just "use sparingly"; you may have made it this far without them
  • for bigger or structured data, just use native file format (JSON, YAML, PSD1, XML, HTML, CSV, whatever)