Greetings!
Thought to share an useful time saving tip while writing Powershell scripts. I wanted to uninstall the default CUS Model in AX 2012 from one of my local development environments. And because of the space in the model name between the words CUS and Model I got this error
For sometime, I struggled with the below error as shown below.
Solution:
However the solution was to use the escape character (grave-accent) ` which is on the left hand side of your keyboard between CUS and Model as shown above.
i.e.
Uninstall-AXModel -Model CUS` Model
7 comments:
I thought you could use quotes around it. Now i always use the model ID :)
I thought you could use Quotes (i think ive done it before). Now i always use model id instead
Hello,
an another solution is to embrace Model name by "
Uninstall-AXModel -Model "CUS Model"
Well Guys. Thanks for your comments. i didn't get it to work using quotes. Hence had to use the escape character. Yes I agree with Model ID. However in this scenario the model id and name is the same.
Single quotes work.
'cus model'
You could also lookup the model Id and just use the model number, which is sometimes handy as well
Update - I recently had to uninstall the cus model once again in R3 CU8 Environment and using double quotes work e.g.
Uninstall-AXmodel -Model "CUS Model" -Server "MyServerName" -Database "Mydbname_model" -Details
Make sure if you have multiple instances of AOS, to specify the database name so that it deletes the model from right instance
Post a Comment