# Enclose a list of strings in quotation marks using PowerShell

Have you ever needed to enclose a long list of strings into quotation marks? I am in such a situation quite often. The last time it was when I was creating function [Get-CMLog](https://doitpsway.com/powershell-function-that-super-simplifies-getting-the-right-sccm-log) and I needed a list of available log names for the `ValidateSet` param check 👇. 
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638983472766/x1ACua0d1.png)
As you can see it would be super annoying to enclose it by hand. Moreover I got tired by creating code snippets like this `(Get-Clipboard) -split "," | % {"'" + $_ + "'"}` over and over again so I've decided to create small [Quote-String](https://github.com/ztrhgf/useful_powershell_functions/blob/master/Quote-String.ps1) function 💡.

---

# What are the Quote-String function features
- supports **input **from **pipeline**, **parameter**, and **clipboard**
- splits given string(s) using a **customizable delimiter**, **enclose ** the resulting items in the quote, and **outputs ** the result into **console ** or **clipboard**
 - result can be **joined ** or outputted as an **array**

---

# How to use it
- [Download](https://github.com/ztrhgf/useful_powershell_functions/blob/master/Quote-String.ps1), **dot source** and **call ** it like 👇
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638982983206/PINFTzOw57.png)

