Windows PowerShell Cookbook By Lee Holmes

imageThis Cookbook provides hundreds of tested scripts that you can use right away to administer Windows systems using Microsoft’s new tool-everything from automating routine tasks to working with files, event logs and other forms of structured data to managing the users and resources of complex Windows networks.

You get an array of recipes covering PowerShell fundamentals, common tasks, and administrator tasks, including:

  • Pipelines, variables, objects, looping and flow control, strings and unstructured text, calculations and math
  • Simple files; structured files; Internet-enabled scripts; code reuse; lists, arrays and hashtables; user feedback; error management; environmental awareness; script signing; and more
  • Files and directories, registry manipulation, comparing data, event logs, process cmdlets, service cmdlets, Active Directory, enterprise computer management, and more

 Table of Contents

  • Paperback: 584 pages
  • ISBN-10: 0596528493
  • Optimizing the Silverlight Install Experience

     

    image A few helpful tips:

    • - Use the inplaceInstallPrompt:true parameter in CreateSilverlight.js to present the Silverlight installer directly from the current home page rather than redirecting the end-user to the Silverlight site for the installer.
    • - Use the <div> tag into which Silverlight content is presented to create pre-install content (e.g. a static image that provides a glimpse of the final site experience when the user installs Silverlight) and present the Silverlight installer button as an overlay over that image;
    • - Use the Silverlight.ua.Browser property to provide guidance to the user (for example, warning them that they
    • may not be able to install Silverlight if they are using Netscape 4.0 as their browser).
    • - Use a timeout delegate to see if the installation is complete, and, if so, refresh the browser automatically so the end-user doesn’t have to manually hit F5 to reload the content.

    A msi that provides further guidance around installation in the form of a whitepaper and sample code.

    Via Optimizing the Silverlight Install Experience

    LINQ provider for Flickr

     

    Now, Let’s say, i want to get a particular user’s (“chschulz”) photos with “New york” as search key  and I also want only the first page, where each page should have 5 items.

    The code snippet for that will be :

    // create the context
    FlickrContext context = new FlickrContext();
    // set the user.
    stringuser = “chschulz”;
    // do query.
    var query = (from ph in context.Photos
    where ph.User == user && ph.SearchText == “New York” && ph.PhotoSize == PhotoSize.Thumbnail
                 select ph).Take(5).Skip(0);
    foreach (Photo p in query)
            Console.WriteLine(p.Title + “\r\n” + p.Url);

    API is never done without a photo add operation. Snippet for that :-

    FlickrContext context = new FlickrContext();
    context.Photos.Add(
    new Photo{ FileName = Path.GetFileName(uploader.Value),
    File = uploader.PostedFile.InputStream, ViewMode = ViewMode.Private});
    context.SubmitChanges();

     

    The API can be downloaded at : LINQ to Flickr API

     

    Via New LINQ provider for Flickr – Mehfuz’s WebLog

    Gallery Server Pro – An ASP.NET gallery for sharing photos, video, audio and other media – The Code Project – ASP.NET

     

    Gallery Server Pro is a powerful and easy-to-use ASP.NET web application that lets you share and manage photos, video, audio, and other files over the web.

    • Stable, production ready.
    • Use any web browser to organize your media files into albums you can easily add, edit, delete, rotate, rearrange, copy and move.
    • Easily add thousands of files using one-click synchronize and ZIP file upload functions. Thumbnail and compressed versions are automatically created.
    • Powerful user security with flexible, per-album granularity.
    • Integrates with DotNetNuke and other frameworks to provide a superior media gallery.
    • Image metadata extraction. Supports these formats: EXIF, XMP, tEXt, IFD, and IPTC.
    • Search function queries title, caption, filename, and image metadata.
    • Image watermarking with your own text and/or image.
    • AJAX-enabled for more responsive UI.
    • Web-based installer makes installation painless.
    • Uses SQL Server 2000 or higher as the data store. Supports MSDE 2000 and SQL Server 2005 Express.
    • Uses ASP.NET Membership provider so you can integrate with your existing accounts, including Active Directory.
    • Data access uses the ASP.NET Provider model, which allows other data stores such as MySQL, MS Access, or Oracle to be used instead of SQL Server.
    • 100% managed code written in C# and ASP.NET 2.0.
    • Source code is released under the open source GNU General Public License.
    • All web pages target XHTML 1.0 Strict and CSS 2.1 standards to ensure maximum forward compatibility.

    You can play with an online demo of Gallery Server Pro to get a sense of its capabilities. A pre-compiled version is available at www.galleryserverpro.com as well as additional documentation and a support forum.

    Gallery Server Pro – An ASP.NET gallery for sharing photos, video, audio and other media – The Code Project – ASP.NET