how do i change the rotation of an objects particle system shape in script?

i have tried this and a couple of variations so far:

var MySystem = Target.gameObject.GetComponent();
var Shape = MySystem.shape;
var Emission = MySystem.emission;
var MyRotation = Shape.rotation;
MyRotation.Set
    (
    Target.position.x - transform.position.x,
    Target.position.y - transform.position.y,
    Target.position.z - transform.position.z
    );
Emission.SetBursts(new ParticleSystem.Burst[]
{
    new ParticleSystem.Burst(0,3,1,1,Mathf.Infinity)
});
MySystem.Play();

fixed it by putting the references to the particle system in variables

        var Test = Quaternion.LookRotation(Target.position - transform.position).eulerAngles;
        var MySystem = Target.Find("TurretDamage").GetComponent<ParticleSystem>();
        var MainSystem = MySystem.main;
        var Shape = MySystem.shape;
        var Emission = MySystem.emission;

        
            MainSystem.gravityModifier = 0;
            Shape.rotation = new Vector3(0f, Test.y, 0f);

            Emission.SetBursts(new ParticleSystem.Burst[]
            {
            new ParticleSystem.Burst(0,5,1,1,Mathf.Infinity)
            });
            MySystem.Play();