Software Detection Script - Advice Appreciated.

Hey guys, I am currently running a powershell script as a Configuration Item under SCCM 2012 but am looking to expand its functionality - this is where I am hoping someone can help...
My script at present is as follows:
param(
    ## The name of the software to search for
    $DisplayName = "*"
Set-StrictMode -Off
 $compliance = "true"
## Get all the listed software in the Uninstall key
$keys =    Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
## Get all of the properties from those items
$items = $keys | Foreach-Object { Get-ItemProperty $_.PsPath }
## For each of those items, display the DisplayName and Publisher
foreach($item in $items)
 if (($item.displayname) -and ($item.displayname -like $displayname))
   ## write-host $item.displayname
  switch ($item.displayname)
     "7-Zip 9.20" {$dummy=1}
     "Adobe Flash Player 11 ActiveX" {$dummy=1}
    default {$compliance = "False";$result=$result + $item.displayname + "`n"}
## write-host "======================================"
  Write-Host $compliance "`n" $result
## write-host "why:" $result
So, basically it looks through all the programs under the "Uninstall" part of the the registry and compares it against those I detail in the script (I have much more listed but removed them to spare this post) - my question though is I want to
expand the script to "ignore" certain software (for example Video drivers) and this is where I could use some guidance.
Can anyone recommend an approach or a command to help me achieve this?
Thanks in advance.

It makes no sense and I am not going to try and figure out how you thought it up.
Here is how to find in something belongs to a collection.
$items=@(
     '-Zip 9.20',
     'Adobe Flash Player 11 ActiveX'
if($items -contains 'Adobe Flash Player 11 ActiveX'){'Found'}else{'not found'}
You can list as many things in the array as you need.  If one matches it will be found.  A switch is overkill in this case and your use is suspect.  The code you posted won't work and is hard to understand what you are trying to do.
Look in the repository for scripts that retrieve uninstall items from the registry.  They will likely have what you need.
¯\_(ツ)_/¯

Similar Messages

  • I have a kodak printer hero 5.1, it prints or scans  2 or 3 jobs then loses comms with mac although the wifi light is still on. I tried to uninstall software but when I go to printers folder "no such folder message" . Any advice appreciated.

    I have a Kodak printer hero 5.1, it prints or scans 2 or 3 jobs then loses comms with mac although wifi light is still on. I have tried  to remove printer by deleting in preferences but when i try to go to printer folder " no such folder " message appears. Any advice appreciated.

    Log in to the Developer forum. You will find instructions on how to install the lastest beta. Your problem is the beta you have installed has expired. All of them did on October 5; you will find hundreds of threads discussing this. If you have a beta it is assumed that you will continue as a beta tester, so a simple update using iTunes will not work.
    If you no longer want to be a beta tester install the GM 7.0.2 by restoring from iTunes using DFU mode.

  • Late 09 MB Pro 13" now on Mountain Lion keeps crashing (spinning wheel) and getting VERY hot. Even Safe Mode slow to work. Managed a back up last night and wondering should I put the original ios disc back in to take it back to SL. Advice appreciated!

    Hi
    For past year or so my mac book has been getting gradually worse. Spinning wheel, and overheating, last night I had trouble just getting it to start in Safe Mode (been using the on/off button a lot lately!)
    Problem may be related to media - iMovie followed by iPhoto are the most likely programs to bring everything to a stop but not always.
    I'm not an expert although I did figure out how to re install the operating system from the partition with help from this forum a couple of months ago but it didn't fix the problem.
    The iOS is Mountain Lion (via Lion)
    I managed to do a back- up last night and now wondering if I should re- install Snow Leopard from the original discs that came with the laptop. 
    Got a lot of media on there (replaced the 250gb drive with a  Samsung 1tb a while back which is less than half full.
    Never had to use any of my back-ups before so:
    If I re install the original operating system will I be able to be selective in what I put back on later?
    and -
    Will there be any issues putting a Mountain Lion back-up into a Snow Leopard iOS?
    A lot of whats there isn't needed but don't want to lose it completely.
    Advice appreciated thanks

    Back up all data immediately as your boot drive may be failing.
    If you have more than one user account, these instructions must be carried out as an administrator.
    Triple-click anywhere in the line below on this page to select it:
    syslog -k Sender kernel -k Message CReq 'GPU|I/O' | tail | open -ef
    Copy the selected text to the Clipboard (command-C).
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V).
    The command may take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear.
    A TextEdit window will open with the output of the command. Normally the window will be empty. If you get output like this:
    kernel[0] <Debug>: disk0s2: I/O error
    the boot drive is failing, or there's some other hardware fault in the storage subsystem.
    If you get output like this:
    kernel[0] <Debug>: ** GPU Debug Info Start **
    kernel[0] <Debug>: ** GPU Debug Info End **
    there's a fault in the graphics processor or logic board. The two kinds of output are not mutually exclusive, but if you get both, a logic-board fault is likely.

  • Best / most popular software or scripts for adding search function to website?

    I'm trying to find a good piece of software or script for implementing a site search function into our website.  I am relatively knowledgeable in Dreamweaver and can write CSS and XHTML at the fairly intermediate to advanced level, as well as work with JavaScript and js files, but I don't really know much ASP or "by hand" Java coding.  Their are so many scripts and software out there for adding a site search that it's hard to sort through and narrow down.  I was hoping to find reviews of the popular ones or "top 10 lists" of some sort that would help me pinpoint a good one, but can't find anything like that.  These are the primary needs of the website:
    --Has under 50 searchable pages that won't change much and probably won't exceed 50. There are product part numbers and descriptions for some 250-300 part numbers, spread across only 24 of those pages.  The remaining pages are important but no part numbers-- About Us, News, Where to Buy, History, Featured Products, etc.  The product pages are very much like an online store but we don't sell directly on the site (only thru distributors/reps).
    --We are trying to keep the price under about $50, or use a free solution
    --The pages are all static XHTML+CSS pages, but our server can run ASP (we have another website for one of our other product line divisions, on the same server, with many more products beyond 1000, which was programmed completely in ASP by an outside company about 4 years ago).  We self-host both sites.
    --Our server can't run PHP
    --The search capabilities need only be rather basic-- a keyword search with a results page that uses the same design template as the rest of the site.  It would be nice, but not mandatory, to have a search filter and/or a drop down menu to enable selectively searching only certain parts of the site, or only product/part number search vs. general search, etc. (but again, not mandatory).
    --I do have a sitemap page already on it, if that matters or helps
    Some of the ones I've found so far that looked the most promising include:  Zoom Search Engine (http://www.wrensoft.com/zoom/), Site Search Pro (http://www.site-search-pro.com/), and FX Site Search which is a DW Extension I found in the exchange (http://www.felixone.it/extensions/prod/mxssen.asp)-- (that one looks possibly technically challenging or requiring more ASP skill, though)
    Forgive me if there is a better area to post this, if so let me know.

    For a static site, your options are:
    Google ~  http://www.google.com/sitesearch/
    Freefind ~ http://www.freefind.com/
    Zoom from Wrensoft ~ http://www.wrensoft.com/zoom/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • I have OS X 10.8.5 trying to upgrade. Have downloaded latest OS X Maverick but to install I am prompted for the Admin Password. I don't believe one was ever set up. I have tried my Apple Id Password but not accepted, Advice appreciated.

    My system is Mac HD OX S 10.8.5. I want to upgrade 10.9.1 and have downloaded it. However, to install it I am prompted for the Admin Password. I don't believe one was ever set up. I have tried my Apple Id Password but not accepted, Advice appreciated?

    If you have 10.8.5 you don't have a PowerPC Mac (PPC).  PPC is for pre-2006 Macs.   Go to Apple menu -> About This Mac to make sure you have an Intel Mac and that you didn't flip the 5 and 8 in your operating system indication.  If you actually have 10.5.8 but you have Intel it gets a lot more complicated to install 10.9.
    10.5.8 is the maximum for PowerPC.
    10.6 can be upgraded on Intel with this tip:
    https://discussions.apple.com/docs/DOC-2455
    And it also help you get up to 10.6.6 or 10.6.8 as needed.
    https://discussions.apple.com/docs/DOC-6271
    will help someone with 10.5.8 determine if they are ready to jump to 10.7 or later.
    If you have 10.8.5, you must install 10.9.0 first (free from the Mac App Store) to get to 10.9.1.
    Backup your data:
    https://discussions.apple.com/docs/DOC-1992
    and check http://www.roaringapps.com/ and your printer, scanner, and peripheral  drivers are compatible with third party vendors before upgrading to 10.9.

  • HT5527 Account status: An error was returned from server. Please try again later - I have been trying to access my account for more than a week... always the same answer any advice appreciated.

    I have been trying to access my iCloud account for more than a week...looking to drop it to the 5GB from current 7GB. I always get the same answer any advice appreciated.  System Preferences clcik on clous = Account status: An error was returned from server. Please try again later
    I have tries later many many times.
    Thanks,
    Sophie

    I don't know why you can't access it, but if you were a MobileMe subscriber with the free extra storage this has now been removed and your account will have reverted to 5GB.

  • HT3819 Have just set home sharing, but on the computer it as been shared with all my tracks have come up individually and there are no sign og selecting my playlists. Is this normal and also there is no sign of my audio books.??? Any advice appreciated .

    I have just set up home sharing, but all that has come up on the new computer is all my individual tracks and not my playlists, also there are no sign of my audio books... Is this normal?? Any advice appreciated...

    I'm sorry, but your sister, unless she had already turned on the "Find my iPhone" feature and the person who took the phone has not disabled it, is out of luck. She should report the theft to local police authorities, including the serial number of her iPhone. While her experience is unfortunate, there are good reasons why Apple cannot do anything else about it.
    I hope she gets her phone back.
    Best of luck.

  • Browser detection script

    Hello,
    I'm wondering how playback in Flash or on older browsers work. Does the published content run a browser detection script?
    Thank you.

    Actually this seems to work better:
    if (accept.indexOf("vnd.wap.wml") >= 0) {
         // I have a WAP browser...
    }I thought Opera (being WML compatible) would load the WML content, but thankfully it does not broadcast it in the Accept header.
    Thanks.

  • Flash Detection Script

    The Flash detection script generated by Flash 8 doesn't work
    with IE7 .....andy fixes out there??

    On Wed, 12 Sep 2007 17:48:49 +0000 (UTC), "joeq"
    <[email protected]> wrote:
    > let's say you have a page with that script and some
    flash content on it as
    >well... called scriptwithflash.html (catchy, eh?). i want
    to be able to have
    >that page load if the proper version of flash is found
    and redirect to another
    >page (ohcrapyoudonthaveflash.html) if it is isn't.
    Okay. Now it makes sense. Change this:
    if ( MM_FlashCanPlay ) {
    window.location.replace("
    http://www.leoandsabrina.com/main.html");
    } else{
    window.location.replace("
    http://www.leoandsabrina.com/poop.html");
    To this:
    if ( !MM_FlashCanPlay ) {
    window.location.replace("
    http://www.leoandsabrina.com/ohcrapyoudonthaveflash.html");

  • Detection script -- play alternative movies?

    How can I create alternative content like a quicktime movie
    to play as the alternative content, if user doesn't have flash
    player 8? I can put text or images in script, but quicktime or
    other media embeded in script doesn't show??

    I have a detection script put in my flash movie, which is
    embeded in my Dreamweaver file, from my Flash 8 authoring. It is
    for Flash 8. I want user's who don't have Flash 8 player, to see a
    quicktime version of that movie (in it's quicktime version). In the
    script section "alternative content" I can only place text or
    images and not quicktime or older flash movies -- it doesn't allow
    me to. Is there a way to do this??

  • Email issue with ISP - advice appreciated

    We seem to be having a strange issue with email and our ISP.
    Using OS-X mail, all patched up and on the latest versions of everything. Every two or three months email stops working with no warning, errors or notification. The ISP says that we have been blocked due to excessive failed password attempts, even though it's been working for two months and no passwords have been changed.
    The only way around this is to have the ISP unblock the ipaddress and on the local system delete the ISP certificates from Keychain (login) access, although on one occasion when the ISP was being particularly slow, simply deleting the certificates did the trick.
    I'm not getting anywhere with the ISP - I am unable to get past first line support and pre-formatted answers telling me how to reset my passwords and what combination of numbers, letters and characters make up a good password. (Nativespace in case you're wondering!)
    Advice appreciated. "Leave Nativespace" is already being considered,
    thanks and regards
    Simon

    Meant to say, the certificates are up to date and haven't expired when the email fails.
    My system has several email accounts going through the same server at the ISP - sometimes they all fail, sometimes only one or two.

  • Where are the actual Aperture files located? Only in the application? I am transitioning to Lightroom and would like to only move some of the files. Advice appreciated. Also anyone know how to transfer in with edits?

    Where are the actual Aperture files located? Only in the application? I am transitioning to Lightroom and would like to only move some of the files. Advice appreciated. Also anyone know how to transfer in with edits? Using iMac, OS X, most recent Aperture and Lightroom 5.7 with plugin for Aperture.

    Define "the Aperture files".
    Read this concise guide.
    The files you imported into an Aperture Library can be exported (at any time, and repeatedly) using the command "File ▹ Export ▹ Originals".  Your Originals are never altered.  What went in is what comes out.
    Adjustments and changes to the metadata that you made since creating an Image in Aperture by importing a file are saved to a text file.  This file is combined, on-the-fly, with the Original to create the Image that you see in Aperture.  There is no file saved to disk that is the full-size Image.  Thumbnails are saved, and Previews are saved.  These are JPG files, almost always smaller than the Original.  They are not substitutes for the Image for the use you have.
    When you need a file of an Image to use in another program, you export the Image from Aperture.  "Export" means "Make me a file of this Image according to these file specs I'm providing".  The way to get files of your adjusted Images is simple:  create them by exporting.  Specify "Original size", and use a loss-less image-file format (e.g. TIFF 16-bit) if you want to retain as much visual information as possible.
    Search the Web for information about transitioning from Aperture to Lightroom.  Note that I say "transitioning".  You cannot move a database from one format to another without significant changes, and likely some loss of information.  Adobe provides a tool and some instructions.  I strongly recommend working out the process step-by-step, and then proceeding with first a few Images, then a bushel-ful, and stopping to use the first few, the the bushel-ful, before committing your entire collection to the process.
    As always, never use any computer file without having a back-up.
    We have seen mixed reports here of the success of the LR tool that creates a LR database from your Aperture database.
    If you want to carefully define the process, and test and refine it, use the excellent process-development, analysis, and execution program inShort.
    Sadly, there is not and can never be a good, thorough re-positioning of the digital assets in your Aperture Library to become digital assets in a LR database.  Just as a metaphor for any user contemplating transitioning to another digital asset manager:  that would be like digging up a house in one country, planting it in a hole in another country, and expecting to be able to use the toilet and the sinks, turn on the lights, cook dinner, and sleep soundly.
    HTH,
    Kirby.

  • No previous version of grid software detected on the system

    Hi
    using rac 11.1.0.7 on 2 nodes clusters (OUL5x64) upgrading to 11.2.0 but the upgrade has error. degrade the system back to it old version 11.1.0.7 and now the old CRS are up then try to upgrade to 11.2.0 again but the first screen when select "Upgrade Grid Infrastructure" always receive this error
    [INS-40406] There is no previous version of grid software detected on the system.
    Please help how to get pass this error.
    Thanks,

    Check your inventory.xml file...the crs=true is probably not on the correct entry on one or all of the nodes...running the installer again with the updatenodelist will fix it.

  • Can't Boot Up After Software Update -- Advice Appreciated.

    Hi all,
    I've experienced what seems to be a relatively common problem -- after installing the latest Tiger software update, my machine can't boot up. If I try to log in, it just freezes on the blue background screen. Holding 'shift' to enter Safe Mode just makes the computer shut down. I've tried the advice from Apple listed here:
    http://support.apple.com/kb/TS1417
    I just got a variety of messages, all of which say effectively the same thing: 'Macintosh HD cannot be repaired.'
    What can I do from here, bearing in mind I don't have an install disk. Is there anything I can do without it?
    If I were to borrow a friend's Install Disk (they have Leopard), could I delete everything on my computer and re-install Leopard, and have it work? Or will the problems with my iMac carry over to a new installation?
    (I suspected something was wrong the morning before my iMac was able to boot -- I was getting 'page in/page out' errors when I tried to extract .rar files, or move large files to an external HD, so thankfully I took the chance to make back-ups of everything).
    Any hints or ideas would be unbelievably appreciated -- I'd hate to have to buy a new iMac (for the expense, not because I don't want a new one).

    You can erase everything and start over, but you should Zero the Disk first, but also you need an Install Disc, you can buy Sno/10.6 online, for Leo/10.5 you have to call Apple, who may also supply you with a replacement disk for the original if you have your Serial# handy.
    For other sources of Tiger/10.4, See Tom's, (Texas Mac Man), great info on where/how to find/get Tiger...
    http://discussions.apple.com/thread.jspa?messageID=9755670&#9755670
    You might try this a few times to see if you can fix your Disk...
    Tough without a Tiger Disk, but try fsck...
    To use fsck, you must run it from the command line. Unlike using your mouse to open an application to do something, you'll need to type a text command at the prompt (#) to tell fsck what to do. The Terminal application (/Applications/Utilities) and single-user mode are two examples of command-line interfaces in which you can type such commands. To use fsck:
    1. Start up your computer in single-user mode to reach the command line. Hold CMD+s keys down at bootup.
Note: If necessary, perform a forced restart as described in the Emergency Troubleshooting Handbook that came with your computer. On desktop computers, you can do this by pressing the reset/interrupt button (if there is one) or holding down the power button for several seconds. On portable computers, simultaneously press the Command-Control-power keys. If your portable computer doesn't restart with this method, you may need to reset the Power Manager.
    2. At the command-line prompt, type /sbin/fsck -fy
    (space between fsck and -fy important)
    3. Press Return. fsck will go through five "phases" and then return information about your disk's use and fragmentation. Once it finishes, it'll display this message if no issue is found:
** The volume (nameofvolume) appears to be OK 
If fsck found issues and has altered, repaired, or fixed anything, it will display this message:
*** FILE SYSTEM WAS MODIFIED *** 

Important: If this message appears, repeat the fsck command you typed in step 2 until fsck tells you that your volume appears to be OK (first-pass repairs may uncover additional issues, so this is a normal thing to do).
    4. When fsck reports that your volume is OK, type reboot at the prompt and then press Return.
    http://docs.info.apple.com/article.html?artnum=106214

  • Simple PLATFORM detect script?

    I'm hoping there's a simple solution for this -- I need it up
    and running before Monday.
    I've built two versions of a simple site: one stupid version
    for cel phones/blackberrys, etc., one sensible version for regular
    ol' Macs & PCs. The cel version is the default page. The one
    for computers is in a subfolder.
    Rather than get into an elaborate script that would attempt
    to account every kind of handheld that might hit the site, it seems
    like it should be easier to just simply detect for Mac & PC
    with javascript and route them accordingly to the subfolder. The
    handhelds should just ignore the javascript and stay where they
    are....... right?
    I'm not a javascript person, though -- so if anybody has a
    simple script that does this, I'd be most appreciative.
    Also, is my hypothesis about the handhelds simply ignoring
    javascript correct, or will they choke on it and not render the
    page?
    Many thanks!

    > The handhelds should just ignore the javascript and stay
    where
    > they are....... right?
    Wrong. Many (most? all?) visual phones do javascript.
    The right way to do this would be to build one page with a
    mobile media
    stylesheet - this stylesheet would dumb the page down
    (however, you'd be
    surprised how nice pages look on my iPhone) for cel phones,
    and let the page
    blossom on other media.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Bentmen" <[email protected]> wrote in
    message
    news:gf4lp4$jjk$[email protected]..
    > I'm hoping there's a simple solution for this -- I need
    it up and running
    > before Monday.
    >
    > I've built two versions of a simple site: one stupid
    version for cel
    > phones/blackberrys, etc., one sensible version for
    regular ol' Macs & PCs.
    > The
    > cel version is the default page. The one for computers
    is in a subfolder.
    >
    > Rather than get into an elaborate script that would
    attempt to account
    > every
    > kind of handheld that might hit the site, it seems like
    it should be
    > easier to
    > just simply detect for Mac & PC with javascript and
    route them accordingly
    > to
    > the subfolder. The handhelds should just ignore the
    javascript and stay
    > where
    > they are....... right?
    >
    > I'm not a javascript person, though -- so if anybody has
    a simple script
    > that
    > does this, I'd be most appreciative.
    >
    > Also, is my hypothesis about the handhelds simply
    ignoring javascript
    > correct,
    > or will they choke on it and not render the page?
    >
    > Many thanks!
    >

Maybe you are looking for

  • Text file in the cloud

    I have a Mac Pro, a new iPad and a long time mac.com email address updated for the cloud. I put a .txt fle in the cloud in the Mac. The only place I can see it on the iPad is in settings/iCloud/Manage Storage. Of course it can't be opened from the se

  • Is there a way to copy a time machine backup to a second drive?

    I'm in a foreign country and someone wants to buy my laptop, for a price where I can upgrade to the newest model, and have some $$ left over. I have an external drive at home with a time machine backup I did right before I left, but that's it. What i

  • SAP R/3 4.7e compatable with Netweaver foundation ?

    Hi, could you please suggest me for below Queries . 1. Does IS-Media is very much compatable with 4.7e? 2. Will this present problems for us in any of the functionality we've been expecting? Does 4.7 have the same Netweaver foundation, integration wi

  • Com.sap.aii.ibrep.sbeans.upload.RemoteUploadException:

    Hi I'm trying to import an Z-idoc to the XI integration repository, but the import fails with the following message: Import failed with 1 error com.sap.aii.ibrep.sbeans.upload.RemoteUploadException: The objects as displayed in the navigation tree are

  • Hello,  I want to know how to clear the memory or buffer cash from my mac book?

    Hello,  I want to know how to clear the memory or buffer cash from my mac book? When I look at the series, it puts more and more time to load. Thank you. Sorry for my english, i talk french.