ParticleSystem 5.3.4 emissionRate and shapeModule.radius in script

I am trying to change ParticleSystem emissionRate and Shape.radius in a script.

In version 5.2.2 I did have

myParticleSystem.emissionRate = 2.0f; //working.

I could not change shape.radius, so I upgraded to 5.3.4. I think my problems of emissionRate and shape.radius are related.

It is how to get at the sub-parameters of ParticleSystem:

ParticleSystem.ShapeModule shapeModule = (ParticleSystem.ShapeModule)         ps2.GetComponent();
shapeModule.radius = 2.0f;

Does not complain at ‘compile’ time but gives
requested component ‘ShapeModule’ derives from MonoBehaviour or Component or is an interface.
at run time.
I think it is a similar problem getting at the emissionModule to change the Rate:

ParticleSystem.EmissionModule emissionModule = ps2.GetComponent();

I think all examples are for older versions or java. Any suggestions?

This does seem to work: ( as suggested in
Changing the radius of Unity 5.3 Particle Systems - Questions & Answers - Unity Discussions)

var x = ps2.shape; //ps2 is myParticleSystem

x.radius = 2.0f;
But it does not seem correct to use var x in C#.

I think someone there also had problems with the square brackets surrounding the Component. What I think I should be able to do is something like:

ParticleSystem.ShapeModule shapeModule = (ParticleSystem.ShapeModule)ps2.GetComponent < ParticleSystem.ShapeModule > ();

//with square brackets around the ParticleSystem.ShapeModule
shapeModule.radius = 2.0f;

It seems nobody has posted the solution that works that I could find. So I wanted to share:
I was able to get this working using this method, shown in c#:

GameObject dustCloud1;

ParticleSystem.ShapeModule pShape;

pShape = dustCloud1.GetComponent < ParticleSystem >  ().shape;

pShape.radius = whateverYouWant;

Ebonicus’s answer works for me, Unity 2017.1.

what situation I’ve got is: the artist created a 2-level-cascaded particle prefab for grouping purpose, the actual particles are the child nodes, not the top level one. although the top level node has a freaking confusing unused particle system. so changing radius of the top level node has no effect.

the solution is to either move the child nodes to top as root node, or enumerate children nodes to set radius.

post my problem in case anyone got stuck by the same weird problem.