How to handle a $ sign inside a parameter used for SQL code. If I am going with code all My $Some_text (Prefix with $) with Null (Noting Just a space)
POSH command used :
`$attachSQLCMD1 = @" ......... ....
…
OR (OBJECT_ID(‘‘dbo.User Personalization’’,‘‘U’’) IS NOT NULL AND EXISTS(SELECT 1 FROM sys.all_objects (NOLOCK) WHERE type=‘‘U’’ AND (name like ‘’%**$G[_]L Entry’’ OR name LIKE ‘’%$**Item Ledger Entry’')))
…
…
$partitions = Get-WmiObject -computername $serverName -query “SELECT * FROM Win32_DiskPartition”
foreach ($partition in $partitions)
{
[string] $diskpart = “{0}_{1};{2}” -f $partition.DiskIndex,$partition.Index,$partition.StartingOffset
Write-Output $diskpart
"@
Invoke-Sqlcmd $attachSQLCMD1 -QueryTimeout 0 -ServerInstance $SQLServer -maxcharlength ([int]::MaxValue) `
Thanks In advance!!