I want to write a script which creates a php file. For that, I create a text file and I add the code from the script :
New-Item "test.php" -ItemType File -Value
"<?php
require(""iExec2.php"");
$SDescri = new Descri();"
The text file is created but it does not add the variables with a $ :

I tried '$SDescri', "$SDescri", $'SDescri', '"' $SDescri '"', ... in short lots of combinations to add the variable in the text file but none of them work.
Is that possible to do that in powershell or I need to find another way to create a php file with the variables ?