Powershell n00b question

1 post in this topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • ViciousXUSMC
      Remove Windows Apps for All Users
      By ViciousXUSMC
      I have messed with this time to time, but recently decided to go ahead and push it out because I have so many people having the default reader app take over adobe and since they are not admins they cant easily change the default program to adobe for their profile.
      To remove the app for the current user I use.
      get-appxpackage | where name -like '*reader*' | remove-appxpackage If it is a new computer build I can remove the app from the system so it does not install for any new users with this.
      get-provisionedappxpackage -online | where displayname -like '*reader*' | remove-appxprovisionedpackage -online So where I am stuck is getting it off existing accounts on computers in the field.  Every article, document, etc I can find says all you need to do is add the -allusers flag.
      If I add the flag to the get package part it does show the package for each user, but when I pipe it into the remove-package cmdlet I get an error that the package is not installed for the current user and it does not uninstall it for any other account.
      This is what I have tried:
      get-appxpackage -allusers | where name -like '*reader*' | remove-appxpackage Also a revision of it
      get-appxpackage -allusers *reader* | remove-appxpackage As far as I can tell, this is correct but simply is not working. 
      Any ideas or anybody know what the key issue that I am overlooking is?
    • bstjohn
      Silent uninstall broken in Win10 -- need suggestions for workaround
      By bstjohn
      I'm running AutoIT v3.3.14.2 on Windows 10 ver 1511.  The September Cumulative Update from Microsoft has broken the way some third party credential providers work.  You can see more detail here:
      So I want to automatically and silently remove this update from all our machines.  In Windows 7 I could easily do it with this:
      wusa.exe /uninstall /kb:3185614 /quiet
      But apparently Microsoft has taken away the /quiet switch functionality in Windows 10.   wusa /? will show that the switch is there, but when trying to use it error 87 (invalid parameter) is returned.
      So I relented on that point and decided to run wusa without the quiet switch.  It pops up a child window that prompts for confirmation before uninstalling the update.  Sounds like a perfect job for AutoIT, right?  Except I can't get the button to click, either using ControlClick or ControlSend or Send.  I can select it by sending the {Alt} key to it and it highlights.  But I just can't get it to accept the click or {Enter}.
      I then tried using Powershell and DISM to remove the package, but this is a hotfix and doesn't have a package name, so I can't use dism /remove-package, either.
      Does anybody have any other ideas how this can be done silently?
    • TechScott
      Can I user AutoIT as a front-end to Powershell?
      By TechScott
      I have a rather heady PowerShell script that requires a few inputs that I would like to present as pick lists/pull down lists.  I've fiddled with doing this using Windows API calls and frankly it's pretty ugly and non-productive.  What I'd like to accomplish is to present the user with a refined UI that will force them to color between the lines and catch any error putput and display it to them in an organized fashion.
      Has anyone done this?  I'd like to have an AutoIT based solution as my current client didn't plan on any extra time or budget to accomplish this task.
    • iamtheky
      certificate search by thumbprint
      By iamtheky
      #include<array.au3> _ArrayDisplay(_GetCertByThumb("")) ;~ "A1B9894B9BB100F43A229D65CC3C306FBF0BB9F8" Func _GetCertByThumb($sThumbprint = "") $sCommands = 'Powershell get-childitem -Path Cert:\CurrentUser -Recurse -Name | FindStr /L "\\"' & $sThumbprint $iPID = Run(@ComSpec & " /c " & $sCommands, "", @SW_HIDE , $stdout_child) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $aRtn = stringsplit($sOutput , @LF , 2) _ArrayDelete($aRtn , ubound($aRtn) - 1) If ubound($aRtn) < 1 then _ArrayAdd($aRtn , "No Match Found") Return $aRtn EndFunc  
    • MITH
      AU3_DLL ControlMove Functions makes controls disappear
      By MITH
      I am trying to use ControlMove function AU3 DLL in VBA. The function instead of moving the control just makes it disappear. It only appears when I resize notepad manually.
      Can anybody please help me and let me know whats the miss here
      Here's the code I am working on:
      Private Declare PtrSafe Function AU3_ControlMove Lib "C:\Program Files\AutoIt3\AutoItX\AutoItX3.dll" (ByVal szTitle As LongPtr, ByVal szText As LongPtr, ByVal szControl As LongPtr, ByVal nX As Integer, ByVal nY As Integer, nWidth As Integer, nHeight As Integer) As Long Private Function ControlMove(szTitle As String, szControl As String, nX As Integer, nY As Integer, Optional nWidth As Integer = -1, Optional nHeight As Integer = -1, Optional szText As String = "") As Long ControlMove = AU3_ControlMove(StrPtr(szTitle), StrPtr(szText), StrPtr(szControl), nX, nY, nWidth, nHeight) End Function Sub test() ControlMove "Untitled - Notepad", "[CLASS:Edit; INSTANCE:1]", 0, 0, 150, 150 End Sub The Edit Box in Notepad just disappears.