Escaping commands within a lookup

HI All,

Is it possible to use the following in a lookup tale

Get-PSDrive | where {$_.Provider -like “Microsoft.PowerShell.Core\FileSystem”}| ft Name,Root

This is a powershell one liner to find c:\ drive etc.

I want to use it in a lookup table, but what about the quotes, wont they break the csv file?

Cheers

Jake

It’s possible to configure the quote character in the CSV File data adapter:

Hi Jochen,

Can you use an obscure character such as ` or ^ as your quote character as the strings in the csv have both single and double quotes?

Cheers

Jake

Hi Jochen,

Or maybe { as a quote character?

Jake

Sure, any ASCII character which isn’t part of the quoted values should work.

It’s possible, but it doesn’t look good.

id,value1,value2
1,{some quoted value{,{another quoted value{

Hi Jochen,

Here is an example which i know looks horrid but works with [ as quote character and ; as a separator

[Command[;[Category[
[Get-ChildItem Env: | ft Key,Value[;[Privilege Escalation[
[$env:UserName[,[Privilege Escalation[
[Get-LocalUser | ft Name,Enabled,LastLogon[;[Privilege Escalation[
[Get-ChildItem C:\Users -Force | select Name[;[Privilege Escalation[
[Get-LocalGroup | ft Name[;[Privilege Escalation[
[Get-LocalGroupMember Administrators | ft Name, PrincipalSource[;[Privilege Escalation[
[Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon' | select "Default*"[;[[Privilege Escalation[

I posted so that if someone else needs similar functionality they can see how to do it.

Cheers

Jake

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.