how to handle $ inside parameters in powershell

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!!

Use single qoutes to make it literal. If you use double qoutes Powershell will attempt to expand the $:

$tbl = 'User Personalization'

$temp = @'
...
OR (OBJECT_ID(”dbo.{0}”,”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”
    )
)
'@ -f $tbl

$temp