Scripts By Bartek Bielawski

  • Show-Picture by Bartek Bielawski 18 Apr 2011 11:03 AM UTC
    by 2 users

    Advanced Event 8
    3 Comments

    I tried to make this script well.... perfect. ;) * It uses WPK and PSImage Tools from PowerShellPack * If you run it on computer that does not have it - it will give a try and download/ install it from network. * On XP and alike it may fail due to absence of WIA.ImageFile COM Object. It tries to create it early in the script and informs about issue. Gives a link to page where you can get it. * As XP does not support some features of WPF (been there...) it will warn about it if XP is 'detected'. * All controls are transparent, so the picture consumes as much window space as you give to it. It will grow together with window. * Some basic help available inline, more in GUI (press F1 to see it, may fail if network is not available, or at least won't be able to show one picture... ;) * Two parameters -Force (to force it work in MTA powershell.exe and Path to work around the problem of empty pictures folder) - use either. * I know it is huge, but I wanted to cover all scenarios and make it really pretty.... ;) And comment what I do here and there...

  • Library-TempFile.ps1 by Bartek Bielawski 17 Apr 2011 06:33 PM UTC
    by 3 users

    Advanced Event 10
    2 Comments

    Script with single function to create temporary files from pipeline input. Need to dot-source it in order for it to work, thus name of the script. I tried to use all good things that come with advanced functions. I even managed (finally ;) ) to get proper support for 'Yes to All' and 'Now to All' in process block, usually it was asking regardless option selected... ;) I used -confirm:$false to prevent cmdlets from picking up $ConfirmPreference (they would prompt user again). Was not sure which verb too choose (Out or New) - finally decided to go with New, as we create things rather than redirect stuff to something that is always there (like Host... or Null ;) ).

  • New-Log.ps1 by Bartek Bielawski 17 Apr 2011 10:35 AM UTC
    by 2 users

    Advanced Event 9
    1 Comments

    Script that solves Adv9 event. It does all automagically without any info sent to user. However you can always try to force it to. Use -Confirm to get prompted in some situations (rename folder to create file or other way around) and -Verbose to see what is going on. It takes into account situation, where there is folder named like log file, and file name like log folder. It's not in scenario, but may happen and I assumed it would be wise to take this into account. ;)

  • Twitter.psm1 by Bartek Bielawski 12 Apr 2011 10:41 PM UTC
    by 4 users

    Advanced Event 7

    This is v2 module. Update-TwitterID downloads information to CSV, Get-TwitterID will display it (some basic filters available). ConvertTo-TwitterID and ConvertFrom-Twitter ID will allow user to convert both ways ID => FullName and FullName => ID. By default ID.csv file in modules dir will be used, other can be specified (Import-Module -ArgumentList

  • Get-ReadinessInventory.ps1 by Bartek Bielawski 12 Apr 2011 08:49 AM UTC
    by 3 users

    Advanced Event 5
    2 Comments

    Could not find any way to test WDDM-ready on XP. Assumed that if video is DirectX-9 friendly this version will be installed. For HD - sum free space on fixed drives, assumes data can be moved between them. -Debug and -Verbose used a lot. Uses plenty of helper functions so it should be easy to extend it. Suggests on 32/ 64 bit.

  • Get-TwitterID by Bartek Bielawski 11 Apr 2011 07:55 PM UTC
    by 2 users

    Advanced Event 6
    1 Comments

    I think I did all I could to make this script useful. Tested it on several sites, tried to use folder as target path, some path where I could not write, hopefully I have not missed any important piece. ;) You can use Get-Help to find out how to use it, with few examples included.

  • Get-ServiceInfo.ps1 by Bartek Bielawski 09 Apr 2011 12:40 AM UTC
    by 3 users

    Advanced Event 4
    1 Comments

    I was not sure about committed memory (used committed size from taskmgr in Windows 7). Script is using add-type and update-formatData to modify display/ create custom object. To make it more readable I moved definition to the end (normaly I would do it in a module and just keep it in separate files).

  • Get-RecentWinEvent by Bartek Bielawski 08 Apr 2011 09:07 AM UTC
    by 2 users

    Advanced Event 3
    1 Comments

    Testing localhost by default, using ADSISearcher to query AD (only servers version w2k8 and w2k8r2 will be checked). It's using Get-WinEvent so it won't work against older server builds. Tests for local rights, so it should warn you when you try to use it on non-elevated shell.

  • Get-DependentService by Bartek Bielawski 07 Apr 2011 06:03 AM UTC
    by 3 users

    Advanced Event 2
    1 Comments

    Again: by default it will output some strings, but you can change that behavior if you prefer objects. The AD part has server checks hard-coded (filter: operatingSystem = '*server*') so you should not get desktops when you ask for data from AD. Using ADO.NET for all queries to limit number of internal functions ;) To get localhost by default I've used trick with path to get data from $env:computername, hope you'll like it. :D

  • AdvEvent1.ps1 by Bartek Bielawski 05 Apr 2011 07:11 AM UTC
    by 3 users

    Advanced Event 1
    1 Comments

    Because I really don't feel good with strings in the output - I've added -NotFormatted switch to give user option to keep objects in pipe. I'm also not sure if >> will work anyway (encoding issues?). Anyway, I've tried to make it easy to port to a function (advanced) - all you need is Verb-Noun name and couple of curly brackets. ;)