Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

Need double quote in between a variable (Stirng Operation)

$
0
0
Hi Experts,Please help me getting a double quote in between the string. Thereafter I will write a logic to delete that specific folder which I can easily manage through test-path.$INSTALLSHAREDDIR = Get-Content "C:\test\Install_ConfigurationFile.ini" | Where-Object {$_ -like'INSTALLSHAREDDIR=*'} ##O/P : INSTALLSHAREDDIR="c:\Program Files\Microsoft SQL Server"$INSTALLSHAREDDIR = Get-Content "C:\test\Install_ConfigurationFile.ini" | Where-Object {$_ -like'INSTALLSHAREDDIR=*'} $INSTALLSHAREDDIR = $INSTALLSHAREDDIR + "\MSSQL11.INST3"$INSTALLSHAREDDIR1 = $INSTALLSHAREDDIR -replace '"', """"o/P: INSTALLSHAREDDIR=c:\Program Files\Microsoft SQL Server\MSSQL11.INST3Want the output as (within double quotes):-"c:\Program Files\Microsoft SQL Server\MSSQL11.INST3"Thanks

Viewing all articles
Browse latest Browse all 467

Trending Articles