In order for the CustomScriptExtension to be executed on an existing VM, the configuration of that extension must be "different" than the last time it was deployed - if it looks the same, i.e. every property value in the json resource is the same as the last time, the extension is not reapplied.
There are two simple ways you can make the configuration "different".
1) is change any property value in the resource, this might not always be practical (and in some cases the opposite of what you really want to do) so the most reasonable property to change is the fileUris property. Generally this property contains a sasToken, that is generated for that particular deployment. Since the sasToken is different each time the property value changes and the extension is re-applied. You can see a sample of this here:
https://github.com/bmoore-msft/AzureRM-Samples/tree/master/VMCSEInstallFilePS
Look at the scripts in the root, that deploy the template.
2) If #1 doesn't fit the workflow, you can control this a little more by using the forceUpdateTag property on the resource. You "seed" this value with whatever string you want on the first deployment and then change the value on a subsequent deployment to re-apply the extension. So for example, you could use a parameter and increment that value whenever you wanted to force a change.
HTH
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…