Hi,
A string enclosed in double quotation marks is an expandable string. Variable names preceded by a dollar sign ($) are replaced with the variable's value before the string is passed to the command for processing.
A string enclosed in single-quotation marks is a verbatim string. The string is passed to the command exactly as you type it. No substitution is performed.
For example, this will return a user with the name "Patrick"
$user="patrick"
Get-ADUser -Filter "Name -like '$user'"
And this will return a user with the name "$user"
Get-ADUser -Filter 'Name -like "$user"'
In your script, there are no differences for no variable is used.
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.