• Questions to Retired Geek about Get-RestorePoints.ps1

    Home » Forums » AskWoody support » Windows » Windows 10 » Questions: Win10 » Questions to Retired Geek about Get-RestorePoints.ps1

    Author
    Topic
    #2501081

    I’ve read your post at <here> and <here>.

    I’ve downloaded it, extracted the zip folder, and now I have the Get-RestorePoints.ps1 powershell-script file.

    I’ve never run a PS script before, so I have a bunch of questions.

    When I right-click on the script-file name, I get a drop-down menu to “Run with Powershell” but when I do that, I get a MS Window that says it’s not a verified MS-verified app. However, I can click on a button to “Run anyway”. But, this isn’t an app. And when I click on this button to run anyway, nothing happens. (There’s nothing new in Apps & Features.)

    I managed to “read” the script file. {P.S. the comments need to be revised: “the” instead of “they” and “wish” instead of “with”.}

    It looks like I use the name of the script file in the PS command prompt. So, I am guessing that when I open Windows PowerShell (Admin) and I get the prompt C:\WINDOWS\system32>, the name Get-RestorePoints.ps1 goes after that prompt. It looks like an argument to the prompt should be given afterwards, as well.

    What do I type after that for the argument? -nothing? *? -rpType
    12
    ? 12? 0? -0? 1? -1? or what?

    What does it mean for something to display as “APPLICATION_INSTALL”? or as “APPLICATION_UNINSTALL”?

    And, I look at the display results for each of these and compare them?

    Can you post a screenshot (or more), so that I know what to expect with one or more of these arguments?

    Viewing 19 reply threads
    Author
    Replies
    • #2501096

      PS script won’t run in the default PS mode. This is to prevent scripts doing bad things to your system.

      First, make sure you have removed the “mark of the internet” from the script.
      Right click, Properties, Unblock.

      Open a Powershell window. (Win R, powershell)
      Type: Get-ExecutionPolicy -List
      You should see all set to Undefined.

      Change the execution policy.
      Type: Set-ExecutionPolicy -Scope Currentuser -ExecutionPolicy RemoteSigned
      Answer Y

      You should not be able to run the script by double clicking on it, or dragging it to the Powershell window.

      cheers, Paul

      • #2501219

        You should see all set to Undefined.

        For Get-ExecutionPolicy -List, all scopes but LocalMachine are set to “Undefined”. LocalMachine is “ByPass”. What does THAT signify? a problem, I wonder?

    • #2501108

      The only way I could get the script to run correctly was the following:

      Download the script
      Extract the downloaded zip file to get the Get-RestorePoints folder with the Get-RestorePoints.ps1 script and a ComputerMentor.ico file.
      Highlight the Get-RestorePoints.ps1 file and select Copy Path to copy the path to the script.

      Open Power Shell with Admin privileges
      At the prompt enter Set-ExecutionPolicy RemoteSigned and press enter (as directed by Paul)
      At the prompt enter A As Yes to all (selecting Y did not work)
      At the prompt enter & and press Ctrl + V to paste the copied path to the script. No space between & and Path to script. Press the Enter key. Select the 0 Installation option and it should show the last Restore Point of the last installation.

      I could not get the script to run with double click or Run in Power Shell (access denied – not an admin Power Shell). Dragging the script to the Power Shell window did nothing on my system (Windows 10 home).

      All other methods I tried resulted in an error message.

      HTH, Dana:))

      1 user thanked author for this post.
      • #2501138

        Select the 0 Installation option and it should show the last Restore Point of the last installation.

        At the outset, I should have said I am Win10/Pro 21H2.

        So, what do you type, if you want to get all of the Restore Points, not just the last one of the last installation?

        Following Paul T, should it be Set-ExecutionPolicy -ExecutionPolicy RemoteSigned? or should it be Set-ExecutionPolicy RemoteSigned? {note: answered below by Rick Corbett. Thanks!}

        Afterwards, do I set Set-ExecutionPolicy RemoteSigned back to what it was before I started all of this? (I am thinking that I need to remove the ‘RemoteSigned’ permission (or whatever it is) back to something more restrictive (or maybe ‘undefined’??))
        If so, what should Set-ExecutionPolicy be to get it back to the original?

    • #2501143

      Can you post a screenshot (or more), so that I know what to expect with one or more of these arguments?

      First, a couple of observation:

      it’s not a verified MS-verified app
      It’s a script that needs to be run from a PowerShell console, not an application. Microsoft’s notification popup fails to make the distinction.

      And when I click on this button to run anyway, nothing happens. (There’s nothing new in Apps & Features.)
      It’s not an installable app… so won’t appear in Apps & Features.

      It looks like I use the name of the script file in the PS command prompt.
      Yes… but first you need to do two things: 1) Unblock the script and; 2) Change the default ‘Execution Policy’.

      Here’s one way to do it, step-by-step:

      1. Create a folder, for example C:\Scripts (a).

      2. Download RG’s zip file to C:\Scripts (b).

      3. *Right*-click on the zip file and choose Properties (c).

      4. Put a tick in the Unblock checkbox (d) and click on Apply, then OK to dismiss the dialog.

      unblock_zip
      (This will not only unblock the zip file but also its contents.)

      5. Unzip the zip archive to a Get-RestorePoints folder. Now you’re ready to run it.

      6. *Right*-click on Start and choose Windows PowerShell (Admin).

      (Note: Some PowerShell scripts will run in a standard unelevated PowerShell console but I tend to always use an elevated console for convenience.)

      6. When the console appears, type (or copy/paste) the following then press RETURN/ENTER:

      Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

      7. Enter a (for ‘Yes to All’) then press RETURN/ENTER. This will allow PowerShell to run RG’s script.

      8. Now ‘change directory’ (cd) from C:\Windows\System32 to the C:\Scripts folder by entering the following commands one-by-one, pressing RETURN/ENTER after each one:

      cd..
      cd..
      cd scripts
      cd get-restorepoints

      You’re now in the right folder… so all that’s left is to run the script using dot-slash notation (meaning here).

      9. Type (or copy/paste) the following then press RETURN/ENTER:

      .\get-restorepoints

      To recap, your console should look like this:

      console_commands
      This will run the script and display the script’s UI in the console:

      10 Click on the List Restore Points button to display ALL restore points or enter a Type number in the filter box (shown arrowed) to narrow the search:

      get-restorepoints02
      For example, enter 1 in the filter box then press the List Restore Points button to display only restore points created by an Uninstall action.

      11. After you click on the Exit button you can set the execution policy back to its default by typing (or copy/paste) the following then press RETURN/ENTER:

      Set-ExecutionPolicy -ExecutionPolicy Restricted

      Hope this helps…

       

      Attachments:
      1 user thanked author for this post.
      • #2501148

        Hope this helps…

        Yep, I can follow this!!

        A couple of questions, though.

        For example, enter 1 in the filter box then press the List Restore Points button to display only restore points created by an Installation action

        A. Doesn’t the choice of ‘0’ in the filter box (and not a ‘1’), display only restore points created by an Installation action??

        B. If the choice in the filter box is ’12’, what does the ‘Modify Settings’ filter produce?

        C. After all is ‘said and done’, should I put the ‘Execution Policy’ back to its defaults? If so, what does that command look like? {I see that you have now posted an answer to this question. Thanks.}

    • #2501164

      Hope this helps…

      Yep, I can follow this!!

      A couple of questions, though.

      For example, enter 1 in the filter box then press the List Restore Points button to display only restore points created by an Installation action

      A. Doesn’t the choice of ‘0’ in the filter box (and not a ‘1’), display only restore points created by an Installation action??

      B. If the choice in the filter box is ’12’, what does the ‘Modify Settings’ filter produce?

      C. After all is ‘said and done’, should I put the ‘Execution Policy’ back to its defaults? If so, what does that command look like? {I see that you have now posted an answer to this question. Thanks.}

      I realised I had made a typo and corrected it from ‘Installation’ to ‘Uninstall’, probably whilst you were still reading the earlier incorrect version.

      Sorry but I don’t know what Restore Point type 12 (‘Modify Settings’) is… I couldn’t find any info. Hopefully RG will answer this.

      As for reverting execution policy back to its default, that’s your choice. I do a lot of experimenting with PowerShell and have umpteen backup images so I leave my execution policy at ‘unrestricted’. However, it’s a personal choice about which I know the risks and I always read through the code before running for the first time. I wouldn’t offer this as advice though… so you have to decide for yourself.

      Hope this helps…

      EDIT: I found the info about the Modify Settings type. It means a Restore Point created by an ‘Add/Remove Features‘ operation. See Restore Point Description Text for more info… even though it doesn’t mention its type number (12).

      1 user thanked author for this post.
    • #2501191

      What is the difference in the effect/result between Paul T’s command Set-ExecutionPolicy -Scope Currentuser -ExecutionPolicy RemoteSigned, which (I think) limits ‘RemoteSigned’ to only the ‘Currentuser’ scope and Rick Corbett’s command Set-ExecutionPolicy -ExecutionPolicy RemoteSigned, which (I think) assigns ‘RemoteSigned’ to all the scopes?

      • #2501203

        If perchance some bad guy is able to get a PowerShell script to run under a different user it won’t run without remote execution set for that user.

        --Joe

        • #2501218

          These are all the scopes: MachinePolicy, UserPolicy, Process, CurrentUser, and LocalMachine.

    • #2501230

      @WCHS:

      Here’s how to open (and run) Get-RestorePoints.ps1 with PowerShell:

      1. Open File Explorer and go to the folder where Get-RestorePoints.ps1 is located.

      2. Right click on Get-RestorePoints.ps1 and choose Open With.

      3. The program you want to open it with is powershell.exe, which is found in the following folder: c:\windows\system32\WindowsPowerShell\v1.0

      At this point, you have run Get-RestorePoints.ps1 with PowerShell. However, if you want to set Windows to automatically run any .ps1 file with PowerShell, right-click on the file again, check the “always open with” box, and click on PowerShell.

      Group "L" (Linux Mint)
      with Windows 8.1 running in a VM
    • #2501235

      What is the difference in the effect/result between Paul T’s command … and Rick Corbett’s

      Because Rick runs Powershell as admin it changes all scopes.

      To see what is currently set: Get-ExecutionPolicy -List
      “Bypass” = nothing is blocked. This is not good m’kay.
      Remote Signed is the correct restriction because only local files that you created or downloaded ones that you have removed the “mark of the internet” from will run.

      cheers, Paul

      1 user thanked author for this post.
      • #2501343

        To see what is currently set: Get-ExecutionPolicy -List
        “Bypass” = nothing is blocked. This is not good m’kay.
        Remote Signed is the correct restriction because only local files that you created or downloaded ones that you have removed the “mark of the internet” from will run.

        I saw your answer to my question about LocalMachine = “Bypass” <here>

        If I read your post correctly, LocalMachine = “Bypass” is not a good thing and it’s best to change it to “RemoteSigned”.

        As for the OTHER scopes (MachinePolicy, UserPolicy, Process, CurrentUser), they are currently “Undefined” (I have not yet changed anything and I have not yet run Get-RestorePoints.ps1). Reading between the lines in your post and reading other posts here, I think I hear that it is best for these 4 scopes to be “Restricted”, unless there is a good reason to reset Currentuser to “RemoteSigned” (e.g., for running Get-RestorePoints.ps1). Is that right?

        If this is correct, then is it the case that I can run PS in administrative mode, and by using these commands in sequence (*see below), this will be the best strategy to keep the baddies out?

        a. Set-ExecutionPolicy -ExecutionPolicy -MachinePolicy Restricted and answering with an “Y” (for ‘Yes’’),
        b. Set-ExecutionPolicy -ExecutionPolicy -UserPolicy Restricted and answering with an “Y” (for ‘Yes’’),
        c. Set-ExecutionPolicy -ExecutionPolicy -Process Restricted and answering with an “Y” (for ‘Yes’’)
        d. Set-ExecutionPolicy -ExecutionPolicy -Currentuser Restricted and answering with an “Y” (for ‘Yes’’)
        e. Set-ExecutionPolicy -ExecutionPolicy -LocalMachine RemoteSigned and answering with an “Y” (for ‘Yes’’)
        *I had earlier mistyped Corbett’s command: he had said “Restricted”, but in my post about differences I had typed “RemoteSigned”.

        And, if I want to run RG’s Get-RestorePoints.ps1, I can?
        f. use Set-ExecutionPolicy -Scope Currentuser -ExecutionPolicy RemoteSigned and answer ‘Y’,
        g. run Get-RestorePoints.ps1 (unblocking it first),
        h. then put the Currentuser scope back to what it was before running the powershell script by using Set-ExecutionPolicy -Scope Currentuser -ExecutionPolicy Restricted and answer ‘Y’.

        I don’t want to disrupt the ability to run these two most-often-used PS commands SFC /verifyonly and SFC /scannow. These require administrative mode.
        Occasionally, I will use these DISM commands, also requiring administrative mode:
        1. DISM /Online /Cleanup-Image /CheckHealth
        2. DISM /Online /Cleanup-Image /ScanHealth
        3. DISM /Online /Cleanup-Image /RestoreHealth

        And for checking the component memory, I use:
        4. DISM /Online /Cleanup-Image /AnalyzeComponentStore
        5. DISM /Online /Cleanup-Image /StartComponentCleanup

        So, having set the scopes as outlined in a-e above, will this allow SFC and DISM commands to work as they have been working before (when all scopes but LocalMachine were “Undefined” and LocalMachine was “ByPass”)?

    • #2501270

      @WCHS – Paul T’s command Set-ExecutionPolicy -Scope Currentuser -ExecutionPolicy RemoteSigned is the safest.

      Best practice is to use a standard Windows user account and ‘normal mode’ Windows PowerShell, not Windows PowerShell (Admin) from Start‘s right-click Power menu.

      RG’s Get-RestorePoints script just *reads* Restore Point information so doesn’t require an elevated console (nor does execution policy require any wider scope than Current User). RG’s scripts will prompt you if they require elevation.

      (As I mentioned in an earlier post, I tend to use an always-open elevated console as I experiment with amending/creating rather than just reading… but this *isn’t* best practice. See The Differences Between Running PowerShell in Normal Mode Versus Administrator Mode for more info.)

      Hope this helps..

    • #2501344

      Gee you guys have been busy! Sorry I was tied up most of yesterday.

      First some observations:
      The Remote-Signed execution policy prevents you, or anyone else, from running scripts from the internet unless they are signed and you have the appropriate certificate loaded on your machine. Thus, I set and leave my powershell setup at RemoteSigned.
      I always keep all my production PS Scripts in a single directory and then set that directory in my PS Profile.
      Here’s a sample:

      #Computer Mentors System PowerShell ISE Profile     
          
      Function Prompt {
      
        $identity = 
         [Security.Principal.WindowsIdentity]::GetCurrent()
        $principal = 
         New-Object Security.Principal.WindowsPrincipal $identity
      
        If (-NOT ($principal.IsInRole(
          [Security.Principal.WindowsBuiltinRole]::Administrator)))
        {$AdminStatus = "User"}
        Else
        {$AdminStatus = "Administrator"}
        
         $host.ui.rawui.WindowTitle = "PowerShell-ISE $Bitness - $AdminStatus PS $pwd"
         "PS> "
      }
      
      Function Load-ScriptBrowser {  
      
        #Script Browser Begin
        #Version: 1.3.2
        
        $BasePath = 
          'C:\Program Files (x86)\Microsoft Corporation\Microsoft Script Browser'
        Add-Type -Path "$BasePath\System.Windows.Interactivity.dll"
        Add-Type -Path "$BasePath\ScriptBrowser.dll"
        Add-Type -Path "$BasePath\BestPractices.dll"
        $scriptBrowser = 
          $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add(
                 'Script Browser', [ScriptExplorer.Views.MainView], $true)
        $scriptAnalyzer = 
          $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add(
             'Script Analyzer', [BestPractices.Views.BestPracticesView], $true)
        $psISE.CurrentPowerShellTab.VisibleVerticalAddOnTools.SelectedAddOnTool = 
           $scriptBrowser
        
      } # End Function Script Browser
      
      #--- Add Custom Items to Add-Ons menu ---
      $Null = & G:\BEKDocs\Scripts\Production\Set-PSISEOptionsMenu.ps1
      
      $Bitness = & {If([Environment]::Is64BitProcess) {"64-Bit"} Else {"32-Bit"}}
      
      Set-Location -LiteralPath 'G:\BEKDocs\Scripts'
      
      #Change colors for easier reading
      $colors = $host.PrivateData
      $colors.VerboseForegroundColor = "white"
      $colors.VerboseBackgroundColor = "blue"
      $colors.WarningForegroundColor = "red"
      $colors.WarningBackgroundColor = "white"
      $colors.ErrorForegroundColor = "white"
      $colors.ErrorBackgroundColor = "red"
      
      $psISE.Options.FontSize=14
      $psISE.Options.FontName="Lucida Console"
      Set-StrictMode -Version Latest
      $PSDefaultParameterValues = @{'Install-Module:Scope'='AllUsers'}
      
      Clear-Host
      

      Note the Set-Location line.

      For Windows PowerShell your profile is loacted in your d:\Users\Documents\WindowsPowershell file. There are 2 profiles one for the ISE version (Microsoft.PowerShellISE_profile.ps1) and one for the CMD line (Microsoft.PowerShell_Profile.ps1) version.

      For PowerShell Core the profile is located in your d:\Users\Documents\PowerShell folder and is called Microsoft.PowerShell_profile.ps1. There is no ISE version for PS versions 6+ you need to use Visual Studio Code (free).

      When you get a new PowerShell script from anywhere it’s always a good idea to read the comment based help file. You can open the script in NotePad or your fav text editor or from within PowerShell enter the command: Get-Help “d:\path\filename.ps1” -Full

      If you’re truly interested in learning about PowerShell, and IMHO you should be, there is a great set of videos by Jeffery Snover PS inventor available. I know these are for PS 3.0 but they lay down the necessary foundations of the language.

      Rick, thanks for picking up the slack!

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #2501350

        For Windows PowerShell your profile is loacted in your d:\Users\Documents\WindowsPowershell file.

        I am just a common, every day, wet-behind-the-ears user. I have no drive D (unless maybe, I mount an iso file). I found Powershell.exe (version 1.0) in the C:Windows\System32\WindowsPowerShell folder, but there is no Microsoft.PowerShell_Profile.ps1 file that I can find anywhere on the C: drive.

        I don’t know what to make of this post, other than to read up on Powershell and learn about it from the get-go. At this point, all I know is a few things about PS syntax (relying on past knowledge about DOS, PL/1, and Cobol syntax) and knowing how to use a few basic PS commands such as SFC and DISM.

        I’m just trying to figure out if these Get-ExecutionPolicy settings that came with my machine are best practice, and if not, what to do about it. I haven’t ventured into running Get-RestorePoints.ps1 yet, because I think my current scope settings have the potential to let the baddies in and I want to fix that first.

        Get-ExecutionPolicy-List

        Attachments:
        • #2501363

          The small d indicates Drive. For most it is C: however some people windows is installed elsewhere or they may have, as in my case, moved my Documents directory to G:\ thus the use of the generic d: for drive.

          Niether SFC or DSIM are PowerShell commands. They are Windows executable files which can be run from within PowerShell.

          May the Forces of good computing be with you!

          RG

          PowerShell & VBA Rule!
          Computer Specs

          1 user thanked author for this post.
          • #2501373

            Boy, oh boy, did I jump into the weeds!!

            Thanks for straightening me out on little ‘d’ and SFC ad DISM commands.

            I have been reading about Set-ExecutionPolicy and have been introduced to scope precedence, but still haven’t figured out if my current, came-with-the-machine Set-ExecutionPolicy settings are OK or not (see previous screenshot). I think the LocalMachine=Bypass needs to be changed to “Restricted”, and I think that since it has the highest priority, it will overtake the other scopes, which are currently assigned “Undefined”. Not sure about this, though, but that is my current thought.

            And if I want to run Get-RestorePoints.ps1 (unblocking first), I think I should change Currentuser to “RemoteSigned” and afterwords, change it back to “Undefined” or permanently change it to “Restricted” (which may be ‘six of one and half of a dozen of the other’, since LocalMachine will be “Restricted” and will take precedence over all of the other scopes.

            Chewing on this and looking for advice. Please note my earlier remark that I am a total newbie on PS script evaluation/execution. BTW, I have no intention of writing PS scripts myself. I just want to know how to protect my system properly and yet be able to run trusted script that I have downloaded for a special purpose.

            I wouldn’t have fallen in the weeds here and opened this topic, had I not thought about trying your PS script when I had noticed missing manually- created restore points, which I had thought would be there since they are less than 60 days old.

            I remain open to digging out!

    • #2501404

      WCHS,

      If you’re careful about where you download your scripts from I’d recommend that you just set your policy to RemoteSigned and forget it. That’s what I do.

      PS> Get-ExecutionPolicy -list
      
              Scope ExecutionPolicy
              ----- ---------------
      MachinePolicy       Undefined
         UserPolicy       Undefined
            Process       Undefined
        CurrentUser    RemoteSigned
       LocalMachine    RemoteSigned
      

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      1 user thanked author for this post.
    • #2506421

      To Retired Geek:
      You suggested that I give Get-RestorePoints.ps1 a try. Here are the results.

      It looks like it’s stopped listing all of the Restore Points. This is the screen I get when I make no option choice, but click on the ‘List Restore Points’ button alone. Something is showing below the 7th line, but it’s cut off. And there may be more lines below that?? [When I choose the options, one by one, there is a total of 10 Restore Points, not the 7 listed here.]

      List-Restore-Points-1

      Create a Restore Point>System Restore>Show more restore Points shows 25 Restore Points, not 7 that Get-RestorePoints shows. The ones highlighted are missing in Get-RestorePoints.ps1
      new-comparison-with-Create-a-Restore-Point
      Create-a-Restore-Point-1

      Attachments:
    • #2506441

      WCHS,

      Never saw a machine with that many restore points!

      I take it you are not seeing a scroll bar on that text box?

      Try making a change at line 123 in the script:

      
             <Setter Property="Margin"     Value="10,10,0,0"      />
      

      To:

             <Setter Property="Margin"     Value="10,10,5,0"      />
      

      It’s the only difference I can see in the exact same code used in another of my programs that does show the scrollbar.

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #2506444

      No, I DO see a scroll bar in Create a Restore Point>System Restore>Show more restore points.
      I just put screenshots together in Word and then made a screenshot of the screenshots, so that all would be visible at one time.

      About a week ago (on Dec 3, 10:35 PM), I changed the Restore Point Creation Frequency to 0, so that all restore points would be listed after that date/time, even those created the same day. The ones from Backup (the ones shaded in green) had been accumulating before I changed the Restore Point Creation Frequency, though. I use Settings>Update & Security>Backup>Backup and Restore (Windows 7) to do my backups (data and system Image) so that’s what made all of those Backup restore points that you see shaded in green.

      But, I am not seeing a scroll bar in the Get-RestorePoints.ps1 output.

      I’ve never monkeyed with PS script before. If I understand this, I would use Notepad to open the .ps1 file, make the changes you suggest, and then save it with a different name (maybe Get-RestorePoints2.ps1)? And then run it? And I should see a scroll bar in the output so that more restore points will be visible?

      • #2506447

        <Setter Property=”Margin” Value=”10,10,0,0″ />

        occurs in two places. I don’t know the line numbers. Is Line 123 the first occurrence? Or the 2nd occurrence?

    • #2506449

      WCHS,

      Don’t worry, I discovered that was not where the problem was anyway.

      I’m working on a new version to fix this problem and will post on my One Drive when completed and notify all here.

      P.S. I’m creating a slew of restore points on my test machine to make sure this works correctly.

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      1 user thanked author for this post.
      • #2506452

        P.S. I’m creating a slew of restore points on my test machine to make sure this works correctly.

        A slew of restore points of different types, I hope.

        I also found when you do the options one by one and then look at them all together as one whole, you do not get the same results as when you choose no option at all (and get all of the restore points in one run).

    • #2506450

      It doesn’t make any difference if I change the first occurrence only, or the 2nd occurrence only, or both occurrences, I get the same output — no scroll bar.

      Just to review,
      1. I used NotePad to change only the 1st occurrence and then saved the file as Get-RestorePoints2.ps1 Then I used the PS command .\get-restorepoints2
      2. I used NotePad to change only the 2nd occurrence and then saved the file as Get-RestorePoints3.ps1 Then I used the PS command .\get-restorepoints3
      3. I used NotePad to change both the 1st occurrence and the 2nd occurrence and then saved the file as Get-RestorePoints4.ps1 Then I used the PS command .\get-restorepoints4

      No scroll bar
      with-Get-RestorePoints2-3-and-4

      Attachments:
    • #2506459

      WCHS,

      Ok, Version 02.03.00 has been posted. You can use this link to get to my OneDrive.

      This version correctly displays the Scroll Bar on the Restore Points List box.
      I also implemented the disablement of the Window Close (X) box. You must use the buttons on the forms to exit.

      Here’s what the scroll bar looks like:
      RestorePts1

      Here’s what it looks like after you scroll down.
      RestorePts2

      Let me know how it works for you!

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      Attachments:
      • #2506473

        Let me know how it works for you!

        This is the output from the revised Get-RestorePoints.ps1. The scroll bar works and now 11 restore points are listed. Nothing is listed beyond the 11th line, although the scroll bar will go down farther.
        new-Get-RestorePoints

        Here is how the new output compares with Create a Restore Point:
        new-comparison-with-Create-a-Restore-Point

        13 Backup restore points are still missing in the Get-RestorePoints.ps1 output (those highlighted in green)
        1 Scheduled Checkpoint/Automatic RestorePoint is still missing (the one highlighted in blue).

        Notice that the 1 missing Scheduled Checkpoint/Automatic Restore Point (highlighted in blue) has the same time stamp (marked by the red square) as the System Image Restore Point (Backup) just above it but despite the same time stamp, they are two different types.

        Attachments:
    • #2506477

      Why are the ones shaded in green missing from the new Get-RestorePoints.ps1? If they are listed by Create a Restore Point, shouldn’t they also be listed by Get-RestorePoints, too? That they are type ‘Backup’ couldn’t be the reason, because one that is a Backup IS listed (the one on 12/04/2022).

      I can see why the one shaded in blue is missing, if the timestamp is used to make the list. But, the one in blue and the one above it are really two different restore points.

    • #2506569

      WCHS,

      Could you open a PowerShell session as administrator and enter the following command:

      Get-ComputerRestorePoint

      Then copy and paste the results into a reply to this message.

      Thank you.

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #2506570

        Here it is:
        Get-ComputerRestorePoint

        I see that 11 RPs are listed here — the same ones as the non-highlighted entries in my previous Create a Restore Point screenshot (new-comparison-with-Create-a-Restore-Point.jpg). But Create a Restore Point>System Restore>Show more restore points lists 25 in all, counting the highlighted ones. Why does Create a Restore Point list these other 14?? Or put another way, why does this PS screen not list these highlighted 14?

        It looks like Create a Restore Point has access to some place in the system where these 14 are listed/stored.

        Attachments:
    • #2506579

      WCHS,

      Well, that at least tells me it’s not in my program but rather in the builtin Get-ComputerRestorePoints cmdlet builtin to PowerShell. As to why I haven’t got a clue.

      My guess is that the missing restore points are created differently and or created at a higher access level like “Trusted Installer” I see that they are all of the same type “Backup” so this lends some credence to my assumption. What backup program are you using? I’ve never seen that type on any of my systems.

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #2506591

      The green-highlighted ones are of the type “Backup”, but the blue-highlighted one is of the type “Automatic Restore Point”, which your program calls “Scheduled Checkpoint”.

      The “Backup” ones came from Settings>Update & Security>Backup>Backup and Restore (Windows 7) — the backup program that comes with Win 10. I know it’s old (and not Macrium Reflect or some 3rd party backup software), but I understand it and know how it works and know how to use it — b/c I’ve used it for a long, long time, so I’ve just stuck with the same-old, same-old. It backs up my data and makes a system image.

    Viewing 19 reply threads
    Reply To: Questions to Retired Geek about Get-RestorePoints.ps1

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: