waldo1001 / Cloud.Ready.Software.PowerShell

waldo's PowerShell Scripts & Modules
http://www.waldo.be
85 stars 94 forks source link

New option for Get-NAVCumulativeUpdateFile #28

Open SorenKlemmensen opened 7 years ago

SorenKlemmensen commented 7 years ago

Idea to add a CU option for this script so it takes a specific CU and not only the latest. If left blank just download the latest. Again just an idea that would make this much more useful for the majority of developers that are not on the latest version ...

SorenKlemmensen commented 7 years ago

I have made this change and will be submitting a pull request shortly.

waldo1001 commented 7 years ago

Looking forward to it .. because it's not an easy one ;-)

KristofKlein commented 7 years ago

As an Idea:

Of course I love the Blog but with the latest changes by Microsoft to the way to Download the files it could make sense to change the "find the id to just use the ms url?

https://www.microsoft.com/$Language/search/result.aspx?q=

with q=NAV+$Version+Cumulative+$CUVersion+Download $Language = en-us $Version = 2017 $CUVersion = 03 --> https://www.microsoft.com/en-us/search/result.aspx?q=NAV+2017+Cumulative+03+Download

and parse the result from thatone into the Downloader?

waldo1001 commented 7 years ago

That's most certainly a very good idea. I'll look into it when I have the chance..

SorenKlemmensen commented 7 years ago

that sounds very much like what I did. Let me fire up the other computer and send the one I got to you for review. I tested it on several versions and it worked. A few things I made sure of was that if you leave it out as a parameter it works the same as today secondly I do not add the 0 in front of the CU, but if you need CU 2 you put it to 2 and if you need 6 you write 6. The reason is MS doesn't consistently us 02 and 06 but in several cases just write 2 or 6.

SorenKlemmensen commented 7 years ago

I just added the file here for now for your testing. I will do a pull request later, but just wanted you to have a look already.

Get-NAVCumulativeUpdateFile.zip

SorenKlemmensen commented 7 years ago

Looking closer at your suggestion @KristofKlein I did it with just modifying the title filter that we use for the original filter. Let me know what you think.

KristofKlein commented 7 years ago

Hi, I think this is also what I suggested at one point directly on waldos blogs :) At that point the XMLNode search looked a bit different: $blogurl = $feed.SelectNodes(“/rss/channel/item[./category=’NAV $version’ and ./category=’Cumulative Updates’ and ./title=’Cumulative Update $CUVersion for Microsoft Dynamics NAV $version has been released’]”).link | Select-Object -First 1 But does in the end do the same thing and also worked for me (i think it is even more precise as it "marks the spot" where the number is to be expected :P )

And as I called it: it is just an idea to use the MS Search instead of the msdn blog. As it should give you slighty fast what you are searching for as it already includes as the result the ID. Apart from that: the MS Search a bit more up2date as the blog. So you most likly will find the next CU Update before it is announced on the blog. at least that's what I discovered with CU3 ;)

waldo1001 commented 7 years ago

@KristofKlein yes you did .. you both are just too fast for me ;-). But I love it!

I'll leave this open to have a look at the MS Search in stead of the blog. The reason why I used the blog is simply because I inherited it from the previous way of working - where the "only" way to get to know a new CU update was that blog.. .

waldo1001 commented 7 years ago

I tested and approved it, Soren: https://github.com/waldo1001/Cloud.Ready.Software.PowerShell/pull/29

But .. @KristofKlein is very right: we need to turn it into searching in the Microsoft-site directly. The blog rss only contains a limited amount of articles .. . As a result, I'm not even able to find CU1 for 2017.. .

rdebath commented 7 years ago

Actually, I downloaded (nearly) all the old GB updates using the RSS feeds; the blog software they're using constructs feeds on the fly so something like https://blogs.msdn.microsoft.com/nav/2016/03/feed/ is a feed like page for just that month.

This doesn't apply to 2017CU1 though (eg: https://blogs.msdn.microsoft.com/nav/tag/nav-2017/feed/). Because somebody at microsoft has decided the users are too dumb to have access to it. (NB: I've only downloaded the GB version so I can't get any of the other languages either)

KristofKlein commented 7 years ago

Since the Download Part of this Script is a bit shaky I worked a bit further on what follows. Since we deal with several Customers adressing several languages I always have to fetch 5 Version of the CU Updates.

I made now some code unzipping those, unzip the included zip File, create the PlatformHotfix Folder, parse the Changelog Files for all the Object IDs such that I can create a "FilterFile" [just ID|ID|ID per Object Type] for later user.

Finally: Iso the actual DVD Folder and remove all unneeded Folders and Zipfiles afterwards. The results end up in our IT Departments File Server.

To achive this I use quite some scripts from waldo, but also some home-made code :)

Once Again thx to waldo for this nice toolbox he made here. Makes my live easier and I'm looking forward to see more and hopefully I can contribute on it in the future :)

waldo1001 commented 7 years ago

Very much welcome - the download is indeed shaky - I hate it :(. Depends too much on Microsoft people.
When I have time, I will try to indeed only depend on the download-site. thanks for the nice words, and hopefully you'll contribute a lot! :-)