i have a mobile website that is based on jQuery mobile and MVC. unfortunately there are some problems that the javascript and CSS files are cached on the mobile phones and not always reloaded when i take some updates online.
now i am searching a powershell script for my deployment process that adds with the help of patterns to all javascript and css links the string "?v=randomnumber", so that the javascript and css files will be newly loaded on every update. example:
<script type="text/javascript" src="http://localhost/scripts/myscript.js?v=21876">
as i use MVC this replacement should work for all files placed in "views" folder and all its subfolders.
i am not searching a other solution for the caching problem.
so the first step was to loop all files in the "views" folder. i have done this like this:
Get-ChildItem -Path "C:\inetpub\wwwroot\Inet\MyApp\Views" | ForEach-Object {
}
thanks for your help!