Passing variables to powershell script block in a jenkins pipeline
You can't interpolate variables in single quotes or triple-single-quotes. Use triple-double-quotes:
stdoutpowershell = powershell returnStdout: true, script: """ write-output "Server is $envserverName" """