Page 51 of 93 FirstFirst ... 41495051525361 ... LastLast
Results 501 to 510 of 935

Thread: Windows 10 and Office Excel

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    In this and the next posts, is the list from what appears to be the relevant script from the shown video. Each section refers to a Debloat video from Chris.
    I have a few extra notes a second time around, mostly specific to the script.
    Further general notes to the videos, that I did before I had the scripts, start from about here: https://excelfox.com/forum/showthrea...e-Excel/page42
    https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page42

    For anyone coming here to just get the script, you can see them in the code window in each video section. Typically I give the share link to the .ps1 file in the first line and in the second line is the single PowerShell command to start the thing off.
    Code:
    This is the share link to the ps1 file, which , for example you could paste in the ISE window and run it from there.
    This second line is that one command to run thing that you paste in PowerShell
    I checked that the thing initially seems to work, that is to say the .ps1 file runs in the ISE window, ( or in some case in the PowerShell Window !!!), and the single PowerShell command seems to start the thing off.
    But because I am only interested in looking at the coding, I have not tested thoroughly. I expect its very likely that some things from the older scripts may not work anymore, since various things in Microsoft Windows may have changed.



    _________________

    10.10.2018 Debloat Windows 10
    https://www.youtube.com/watch?v=q4ziE5Am0pM
    Share ‘5.02 Debloat Windows 10-q4ziE5Am0pM_10 10 2018.wmv’ https://app.box.com/s/5vkm9g797jgc4sttmvpbl2yu5pj8me60

    Chris just missed the first GUI version from Richard with this video.

    Richard has a very thorough READMe, worth a look sometimes. Nice general intro on how to run……..…Download the Windows10Debloater.ps1 file. Next, open PowerShell ISE/VSCode as an Administrator, copy the source code from Windows10Debloater.ps1 and throw it into PowerShell ISE/VSCode/etc and run it.

    Here is the actual main code page from 10 10 2018 https://github.com/Sycnex/Windows10D...eb3805fc11935f
    Maybe his “prep” coding needs a further look, looks like some refinement I and Chris may have skipped over.
    This was the first Chris explanation of the fundamental running in PowerShell window..
    Set-ExecutionPolicy Unrestricted
    cd 'D:\Temp Opt\GitHub\win10script-master'
    dir ( using dir is not necessary, but is helpful to check that you are where your file is, since dir will cause it and anything else there to be listed )
    .\win10debloat.ps1


    Code:
     Share ‘Richard10102018.ps1’          https://app.box.com/s/luzvsf3vrhc5d3schxpmmg9yxvlv7ahk
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Sycnex/Windows10Debloater/88d4d1ed7b6d26b184bd5b71cbeb3805fc11935f/Windows10Debloater.ps1'))



    06.04.2019 Setting up the perfect Windows 10 Installation | faster, Lighter, and Functional
    https://www.youtube.com/watch?v=nVy4GAtkh7Q
    Share ‘5.26 Setting up the perfect Windows 10 Installation _ Faster, Lighter, and Functional-nVy4GAtkh7Q_06 04 2019.wmv’ https://app.box.com/s/ftp5hc3j9w4on6yfm7md25cgsjhgweyn

    The script is 1 of 5-6 things talked about.
    I will take a guess that Chris may have been using the version from about a month from his video, based on this screenshot from the vid, https://i.postimg.cc/zvF3r7g2/Chris-...06-04-2019.jpg . That is at about minute 2 , 50 seconds
    Here is the actual main code page from March 6 2019 https://github.com/Sycnex/Windows10D...b86ba24e9bef74
    Once again Richard is doing a nice README, here is just a short extract, of one of 3 run methods that he explains
    First Method:

    Download the .zip file on the main page of the github and extract the .zip file to your desired location
    Once extracted, open PowerShell (or PowerShell ISE) as an Administrator
    Enable PowerShell execution
    Set-ExecutionPolicy Unrestricted
    Ubnlock all powershell script ls -Recurse *.ps1 | Unblock-File
    On the propmt, change to the directory where you extracted the files: e.g. - cd c:\temp
    Next, to run either script, enter in the following: e.g. - .\Windows10DebloaterGUI.ps1


    I expect he is suggesting we can run either .\Windows10DebloaterGUI.ps1 or .\Windows10Debloater.ps1
    It’s an interesting point to note in passing that Richard had the GUI here. Chris may have overlooked it as in the next of his Debloat Videos he seems to imply Richard has just introduced the GUI.
    So just out of interest I will include the GUI also here, even though it was not discussed in the Chris video
    Non GUI version
    Code:
      Share ‘Richard6March2019.ps1’      https://app.box.com/s/6hxsf7846nqds9gz4q65s3jdr489yjxx
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Sycnex/Windows10Debloater/f269dbbee37afc2398cc0780e9b86ba24e9bef74/Windows10Debloater.ps1'))
    GUI Version
    Code:
       Share ‘Richard6March2019GUI.ps1’     https://app.box.com/s/9jb475u0zfxub44hw0sd7212kft6moi7
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Sycnex/Windows10Debloater/f269dbbee37afc2398cc0780e9b86ba24e9bef74/Windows10DebloaterGUI.ps1'))
    Here is a pick of how the GUI comes up by the one command to do it all: https://i.postimg.cc/k5DJxpmm/Richards-First-GUI.jpg https://i.postimg.cc/t4BRnH8k/Richar...n-1366x768.jpg

    The GUI is resizable, no scroll bars.
    Note that if you run it from in the ISE, the code gets printed in the PowerShell window, https://i.postimg.cc/SsgK0YpW/First-...ower-Shell.jpg
    Misc Notes:
    $InstallNet35.Add_Click( {

    Write-Host "Initializing the installation of .NET 3.5..."
    DISM /Online /Enable-Feature /FeatureName:NetFx3 /All
    Write-Host ".NET 3.5 has been successfully installed!"
    } )


    ( .NET https://eileenslounge.com/viewtopic....286686#p286686 )


    _________________________

    16.10.2019 Clean Up Windows 10 _ 3 Steps For A Faster computer
    https://www.youtube.com/watch?v=nVy4GAtkh7Q
    Share ‘https www christitus com clean-up-windows-10 16 10 2019.docx’ https://app.box.com/s/q859xwlu6c358s3e3jrmn04zmhgpsovl

    This is Chris’s first use of a GUI by Chris, but its not his, it’s Richard’s
    I suspect that possibly when Chris did this video he may have forgot the last one. This will be his third Debloat video. He seems to refer to his first video in this video, and he seems to refer to the GUI as a recent development by Richard, so he may have forgot his second Debloat video, where Richard did actually have the GUI, but in that second video discussed in my last section, it looks liker Chris missed that. In the second video he looks at the non GUI script.
    https://i.postimg.cc/K8G8gxWX/Chris-...-2019-STEP.jpg "Originally did crap a year ago on LapTop – talking about his first Video , Debloat Windows 10
    _ Step 1 of 3 is Richard Newton script but Richard made it user friendly by https://www.youtube.com/watch?v=mWHiP9K8fQ0&t=215s Minute 3 , 35 seconds
    _a) launch GUI graphic debloat section
    and
    b) a single line: ***, that will run it across the web – you don’t need to download the win10script-master stuff, ( but you can if you like, for example so as to modify the script before running).
    *** iex ((New-Object System.Net.WebClient).DownloadString('https://git.io/debloat'))
    Richard calls it … Quick download link , which is a bit misleading
    Actually Chris missed the fact that Richard had already got his GUI script in Chris’s video, 06 04 2019 Setting up the perfect Windows 10 Installation | faster, Lighter, and Functional

    As Chris is using the one liner PowerShell command It’s a good guess that the script used will be that from sometime between shortly before to up until the upload date, and certainly not after. I took the one from 13 October 2019
    Code:
     Share ‘Richard13Oct2019GUI.ps1’     https://app.box.com/s/1eodub2b5le8hehgp0jwh8ovdqtrupew
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Sycnex/Windows10Debloater/d6387e7275ab2a78ba89dcc69330c5d84083a649/Windows10DebloaterGUI.ps1'))
    GUI is resizable, no scroll bars, as with the previous one, ( but this time no code is pasted out in PowerShell window ) https://i.postimg.cc/cJ7GW3Yv/Richar...n-1366x768.jpg



    ______________________________


    20.06.2020 How to speed up Windows 10 in 2020
    Speed up Windows 10 in 2020

    https://www.youtube.com/watch?v=8E6OT_QcHaU
    8.45 Speed Up Windows 10 in 2020-8E6OT_QcHaU_20 06 2020 https://drive.google.com/file/d/1b_a...?usp=drive_web

    Chris is mostly talking about 2 scripts, Richards once again and another, farag2, he says Richard’s is a bit out of date, and farag2 keeps it better up to date, for from May 2020 , Chris is on 2004.
    Richard Newton script
    Chris says Richards at the time would be OK for version 1903 to 1909
    From the video, it looks like the Richard script he uses is that from 2 months before the video, so I have the one from 20 April 2020
    Code:
     Share ‘Richard20April2020GUI.ps1’        https://app.box.com/s/p61qsbczl7gjj1pqv1ki75laa7spt3zq
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Sycnex/Windows10Debloater/c573efd240add6cd108b667a8d7f5749ea25d52e/Windows10DebloaterGUI.ps1'))
    _._________________________
    Farag2 (
    For the first time use by Chris of the farag2 script, it appears he took a script from 17th June which Chris describes as that from a couple of days ago, and he selected the Win 10 2004.4.5 zip
    https://i.postimg.cc/BbxxdbrB/farag2...04-4-5-zip.jpg
    ( It’s a ridiculous number of pages to go back through !! )
    I am not sure if I have the correct one here,
    https://i.postimg.cc/4yC6LVS3/farag2-19-June-2020.jpg , https://i.postimg.cc/MZRbc3nf/farag2-19-June-2020.jpg
    , as I don’t quite understand the different formats
    ( At minute 8 25 seconds Chris takes a quick look in the ISE at the file https://www.youtube.com/watch?v=8E6OT_QcHaU&t=505s )

    Code:
     Share ‘farag2 19June 2020.ps1’       https://app.box.com/s/l2oixig8ynqyl7nwcwa10xeahofjrj16
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/4b5c37cad6d61e13c6b1fd3bc033668b6eb6bb2f/Win%2010%202004.ps1'))
    Note !!! The code would not run in the ISE, https://i.postimg.cc/vBx7t3Xj/farag2...run-in-ISE.jpg . Also the one line command would not run from the PowerShell window attached to the ISE
    But the one line command did run from the one line command in a normal PowerShell window, ( opened as Administrator ) .


    ______________________________
    Continued in next post
    Last edited by DocAElstein; 04-09-2022 at 06:58 PM.

  2. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    Continued from last post
    From this point, Chris has begun developing his own stuff a lot more

    ______________________________



    28.07.2020 The Fastest Windows 10 Setup ( used on Version 2004 )
    https://www.youtube.com/watch?v=Tfd7BXCo9Xk
    Share ‘8.50 The Fastest Windows 10 Setup-Tfd7BXCo9Xk_28 07 2020.wmv’ https://app.box.com/s/4na7yp2rphq6hwzb9w4ov3h6lz2zil5s


    Chris first attempt at a script, and start of his GitHub stuff. His first uploads were 23July.
    The last upload before a long gap was July 27, so I take that one
    Code:
         Share ‘ChrisFirstScript27July2020.ps1’                  https://app.box.com/s/atcfp24bua063oi2mui4cf9hs5yada39
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ChrisTitusTech/win10script/dc055e1456c75d0011b285cecc88d173fbd2d100/win10debloat.ps1'))
    It’s a very popular video so Chris probably leaves it up. But he does not seem to keep the notes up to date.
    The default installing did not go down too well with most people.

    I see now from the script, that it was actually mostly from this chap here
    https://gist.github.com/alirobe/7f3b34ad89a159e6daa1
    who in turn seems to have got it somehow from someone who left in dismay a couple of years back, and archived all his stuff to read only
    https://github.com/Disassembler0/Win...l-Setup-Script
    Its a lot of single functions. I am not too clear at this stage how bloke 1 got it from the other chaps stuff. Chris mainly seems to have added the small bit to install a few things and do O&O
    a few extra notes a second time around,
    The script was part of the video, and came in a bit unpublicised as a script. He may have been a bit reckless, looking at the home game user, and deciding to force downloads of stuff of his choice.
    It just runs, and no interaction.
    He talks a lot about it being a single command , which is actually close to the title of the next Debloat video. Once again I get the impression he later forgot all about this video.
    The script has a lot of enable parallel Enable functions as all the previous ones did the point being that you could tweak things, the start of his customisation idea.
    He thinks the script reduces Processes by about 25-30

    ______________________________


    There was a period when for a short time some other scripts were available as developed and discussed in a live stream,
    14.08.2020 Creating New Windows 10 Debloat Scripts for you ( Live stream) https://www.youtube.com/watch?v=ER27pGt5wH0
    8.57 Creating New Windows 10 Debloat Scripts for You-ER27pGt5wH0_14 08 2020
    https://drive.google.com/file/d/1O63...?usp=drive_web

    There may have been some bad publicity as some hard scripts were taken by people and used somewhat recklessly, and there seems to have been a bit of a break in development of his script stuff.
    Some copies and shortened videos appeared sometime a bit erratically and out of sequence.
    The live stream which I suspect may have had bad reviews due to the hard script he did, was re released under a new name some time later ( 8.83 Windows Debloat Scripts Live Stream Education-2R28u7o9mls _13 06 2021
    https://drive.google.com/file/d/1xyq...?usp=drive_web
    )


    ______________________________

    24.10.2020 Speed up Windows10 with one commend ( using version 20H2 )
    https://www.youtube.com/watch?v=dO30OnTsJhk
    Share ‘8.60 Speed up Windows 10 with One Command-dO30OnTsJhk_24 10 2020.wmv’ https://app.box.com/s/jkebz6xxoi7gy9wulwunvhwiyy6487hk

    Chris:……This is different from my previous scripts, this does not remove any functionality… I will remake and update regularly This is version 1.0 ???………………
    Still Not got the GUI yet

    Chris seems to regard this as the start of his script work, he seems to strangely ignore/ forget the earlier ones. Perhaps things did not go as well as he hoped, but the videos previously get a lot of views so he leaves them. He seems to keep the notes under the video better up to date from now on than any previous ones.
    He regards this as “version 1”, hence pretty well ignoring previous stuff.
    I will take the script available on 29 October as I notice Chris sometimes makes a few mistakes and/ or makes small changes after suggestions, correction suggestions, shortly after an update video.
    Code:
     Share ‘ChrisSecond(Version1)Script29Oct2020.ps1’                     https://app.box.com/s/s7zwspwft02klem81c747wpoycarkjac
    iex(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/ChrisTitusTech/win10script/08799baf44141c154b6293f96cd979af45976c8e/win10debloat.ps1')
    a few extra notes a second time around,
    He is leaving functionality this time, which might be a polite way of saying, oops I fucked up a bit recklessly last time.
    He adds a restore point at the start.
    There is a bit of difference in the tweaking of if functions are done or not. I have not compared in great detail, but it would not surprised me if he got in a muddle and did not change as much as he thought.
    Security things: Enable Defender, opposed to disable in the last one seems to be one change. This scrip also Enables Firewall, the last one did nothing to it.
    Chris has introduced TitusRegistryTweaks function that appears to do the updates similar to what you could do manually

    ______________________________
    ( .NET https://eileenslounge.com/viewtopic....286686#p286686 )

    ______________________________

    07.11.2020 How to Restore Action Center and More
    https://www.youtube.com/watch?v=dO30OnTsJhk
    How to Restore Action Center and More-H2ydDcqRZyM_07 11 2020.wmv https://app.box.com/s/5nib1qrfhm2kx75ll6vh0ue7bbgvxxwh

    Chris next responded to comments to restore the small square action centre thing at the bottom right what the previous scripts removed. ( While he was at it he made further options to restore Cortana and to hide tray icons )
    At the start he was very vocal about how he responds positively to comments, which further suggests he may be trying to gloss over the problems caused to people by his scripts

    I will go here for the Commit named “Full GUI implementation” on 4 November as there is a break after for a week or two, at which it looks like he has been getting into GUIs big time.
    We have a restore-ac-tray.ps1 ___ Full GUI implementation
    Code:
     Share ‘Chris4Vov2020restore-ac-tray.ps1’        https://app.box.com/s/87vinr0nejgxn77x1flldx504vy29kaz
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ChrisTitusTech/win10script/2f33ed830fa58f79057bfe3454083586a37f4e56/restore-ac-tray.ps1'))
    ( Note on running from the ISE, the code is printed out in the PowerShell window of the ISE )




    ______________________________
    From here is the main start from Chris’s GUI work. At the time of writing this there are 3 main normal videos, although there were some live streams which discussed the scripts. I put the titles and some notes to them just to help orientation


    04.12.2020 The Best Windows 10 Toolbox
    https://www.youtube.com/watch?v=V27McA7ch6w
    Share ‘8.65 The Best Windows 10 Toolbox -V27McA7ch6w_04 12 2020.wmv’ https://app.box.com/s/mex9xn9h4uibif596it2v2u9tfe44vr9

    more square like Richards initially : - https://i.postimg.cc/9FBSv3Y1/Chris-...llox-Win10.jpg - "The DB Tool Box first GUI but/ and is Dec 2020 update
    install choc for download
    December 2020 Update

    There are a lot of “test new gui” at 2 December, 2020, and one last NewWin10 GUI released, so I take that
    Code:
     Share ‘Chris2December2020FirstGUI.ps1’       https://app.box.com/s/2btpz9fefsc57eqagy5iz9janq7622zg
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ChrisTitusTech/win10script/d797628cadc09070b0b585edb5e708ea11858345/win10debloat.ps1'))
    The GUI is almost too big on 1366x768 https://i.postimg.cc/Y0jR251C/Chris-...I-1366x768.jpg
    Note the size of 1050, 700 in the script, and no other rogue bloat script lines, suggest Chris originally had it OK, then fucked it up as he went along https://i.postimg.cc/tTsnspmw/Chris-...xtra-bloat.jpg
    https://i.postimg.cc/053WW2pX/Chris-First-GUI-1366x768-no-size-bloat-fuck-up.jpg https://i.postimg.cc/053WW2pX/Chris-...at-fuck-up.jpg

    a few extra notes a second time around,
    This is where things go from a function to a button click.
    The Update has gone to a more complicated coding that lingers up to current one.
    He thinks the script kills about 30-35 Processes

    ______________________________

    09.04.2021 8.77 Quick Update and PowerShell Updates on Win 10 Scripts
    https://www.youtube.com/watch?v=lowutlqGaio
    https://drive.google.com/file/d/1gzV...?usp=drive_web

    Took the Windows defender out due to anti virus software complaining about it.

    26.04.2021 Windows 10 Toolbox Revamp
    Live stream I can’t get at.

    8.83 Windows Debloat Scripts Live Stream Education-2R28u7o9mls_13 06 2021
    Strangely 8 months after the live stream this comes out a month before the next utility. This came out in Titus Tech Tips
    https://www.youtube.com/watch?v=2R28u7o9mls https://drive.google.com/file/d/1xyq...?usp=drive_web

    https://www.youtube.com/watch?v=rPfzFT7Kq5A


    ______________________________

    06.07.2021 The Best Windows Utility
    https://www.youtube.com/watch?v=rPfzFT7Kq5A
    Share ‘8.85 The Best Windows Utility-rPfzFT7Kq5A_06 07 2021.wmv’ https://app.box.com/s/vobd0u7ecq33j6kvdzqgcln6ewvv09zs

    winget is here, Chris says its there, easier than going through installers like chocolatey??
    I am not sure what’s going on here, with lots of things done on 6 and 7 July, so I will take the newest on 7 July
    This is where some crap came into the GUI size. But I am not sure how https://i.postimg.cc/dtykZpbX/Crap-b...o-GUI-size.jpg , https://i.postimg.cc/QMs0ypg8/Chris-...1-1366x768.jpg

    Code:
           Share ‘Chris7July2021.ps1’                             https://app.box.com/s/2btpz9fefsc57eqagy5iz9janq7622zg 
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ChrisTitusTech/win10script/97d46a6bf3c8023dfe72b52bcabec59cc1a5c791/win10debloat.ps1'))
    a few extra notes a second time around,
    Based on User feedback Microsoft Store and Windows Defender is no longer touched.
    VS Code is there to install, but he says it has telemetry, so you have VS Coduim as alternative
    He does not like to disable Background Apps, so its an option is VS Codium
    Media Player Classic is from a good up to date fork
    He says he combined the searches. – we see later he didn’t
    Something like “Un Hide Tray Icons” is included in the Essential Tweaks , but based on feedback he has a Hide Tray icons in Undo to “put back to stock settings


    I would like to do a digression to check what is going on in searches, due to , and with , the benefit now of having the actual coding used at the time – next post
    Last edited by DocAElstein; 03-28-2022 at 03:24 PM.

  3. #3
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    I would like to check what is going on in searches
    (The buttons for Cortana ( Search ) – only do Cortana )
    04.12.2020 The Best Windows 10 Toolbox
    Windows Search button under System Tweaks
    All the windows search, web search through .. to disable indexer.
    Code:
    $windowssearch.Add_Click({ 
        Write-Host "Disabling Bing Search in Start Menu..."
    	Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0
    	Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -Type DWord -Value 0
    	If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) {
    		New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null
    	}
    	Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "DisableWebSearch" -Type DWord -Value 1
        Write-Host "Stopping and disabling Windows Search indexing service..."
    	Stop-Service "WSearch" -WarningAction SilentlyContinue
    	Set-Service "WSearch" -StartupType Disabled
        Write-Host "Hiding Taskbar Search icon / box..."
    	Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 0
    	$wshell.Popup("Operation Completed",0,"Done",0x0)
    })
    In the next video, Cortana is mentioned in connection with searching, so just for reference, this is behind the : Cortana button under System Tweaks
    Code:
     $cortana.Add_Click({ 
        Write-Host "Disabling Cortana..."
    	If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) {
    		New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Force | Out-Null
    	}
    	Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
    	If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) {
    		New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force | Out-Null
    	}
    	Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
    	Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
    	If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {
    		New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
    	}
    	Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
    	If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) {
    		New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null
    	}
    	Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Type DWord -Value 0
    	$wshell.Popup("Operation Completed",0,"Done",0x0)
    })  



    06.07.2021 The Best Windows Utility
    Chris says, Cortana and Windows search grouped together, as they are related and just doing one tends to mess up the other.
    But take a look at those two buttons….
    $Cortana is Disable Cortana (Search) button and $ECortana is Enable Cortana (Search) button
    Code:
     $cortana.Add_Click({
        Write-Host "Disabling Cortana..."
        If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) {
            New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Force | Out-Null
        }
        Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
        If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) {
            New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force | Out-Null
        }
        Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
        Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
        If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {
            New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
        }
        Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
        If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) {
            New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null
        }
        Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Type DWord -Value 0
        Write-Host "Disabled Cortana"
    }) 
    Code:
    $ECortana.Add_Click({
        Write-Host "Enabling Cortana..."
    	Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -ErrorAction SilentlyContinue
    	If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {
    		New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
    	}
    	Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0
    	Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0
    	Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -ErrorAction SilentlyContinue
    	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -ErrorAction SilentlyContinue 
    	Write-Host "Restoring Windows Search..."
    	Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value "1"
    	Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -ErrorAction SilentlyContinue
    	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "DisableWebSearch" -ErrorAction SilentlyContinue
    	Write-Host "Restore and Starting Windows Search Service..."
        Set-Service "WSearch" -StartupType Automatic
        Start-Service "WSearch" -WarningAction SilentlyContinue
        Write-Host "Restore Windows Search Icon..."
    	Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 1 
    	Write-Host "Done - Reverted to Stock Settings"
    })
    So it would appear that the windows search disable got forgotten about/ missed out, since the disable in this script is identical to the Cortana disable script from the previous
    Some YouTube notes https://www.youtube.com/watch?v=rPfz...BUU9la94AaABAg Thursday 24 March, 2022
    I just compared your script from this time with that from your first GUI discussed in video
    The Best Windows 10 Toolbox
    In the previous video you had two separate buttons for tweaks to disable
    Windows search
    and
    Cortana
    In this video you say you combined them, but..
    …but in fact the script behind Disable Cortana (Search) in this video looks identical to the script behind Cortana button in the previous video.
    At first glanced it looks like you forgot
    This might explain why some time later a Pull request ( which you accepted, but incidentally also messed up ) was to add some script to disable some aspects of windows search
    You seem to have messed up the windows search script in later videos as well, which I will now go and check again.
    I love you Chris, learnt tons from you, but you continue to be like Einstein, a bit of a messy chaotic genius, Lol.







    Just as quick comparisom chech. This is from a mid March 2022 script, and is the $Cortana coding called by a the button “Disable Cortana (Search)
    It suggests that nothing changed in the meantime
    Code:
    $cortana.Add_Click({
        Write-Host "Disabling Cortana..."
        If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) {
            New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Force | Out-Null
        }
        Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
        If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) {
            New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force | Out-Null
        }
        Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
        Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
        If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {
            New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
        }
        Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
        If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) {
            New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null
        }
        Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Type DWord -Value 0
        Write-Host "Disabled Cortana"
        $ResultText.text = "`r`n" +"`r`n" + "Disabled Cortana"
    })  


    I will carry on the general progression in the next post, from about the point I left ( https://excelfox.com/forum/showthrea...ge51#post12782 ) around July 2021
    Last edited by DocAElstein; 04-01-2022 at 11:03 PM.

  4. #4
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    This is post https://excelfox.com/forum/showthrea...l/page51#12784
    https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page51#12784





    Further here I am looking from approx now ( the July 2021 time ), I will try to look carefully at what happened after this point
    On 12 July a large $WindowsSearch.Add_Click( appeared , as did the corresponding button “Search Tweaks”, but the ps1 errors at that new .Add_Click
    If I comment out that section the GUI looks like this
    Sure enough we see the same Guy responsible for the 12 July doing a correction on 18-19 July 2021, which included the missing curly bracket.
    Here is the 19July ps1
    Code:
     Share ‘ChrisSearchTweaks18-19July.ps1     https://app.box.com/s/cbs7go8i2tdxw4wguthgxcviecaxjn6b
    iex ((New-Object System.Net.WebClient).DownloadString(' https://raw.githubusercontent.com/ChrisTitusTech/win10script/71609526b132f5cd7e3b9167779af60051a80912/win10debloat.ps1'))
    And here is the $WindowsSearch.Add_Click(
    https://excelfox.com/forum/showthrea...ll=1#post16473
    https://excelfox.com/forum/showthrea...ll=1#post15748
    https://excelfox.com/forum/showthrea...ge51#post15748

    The two Cortana script bits look to have not changed at this stage.

    $WindowsSearch button gone, script still there
    As far as I can tell the $WindowsSearch.Add_Click( scripting is still there and always wassince it was first introdunced mid July, 2021. However, the Button for $WindowsSearch, “Search Tweaks” seems to have vanished for no apparent reason on 4 August. There were two commits, and somehow the button vanished between the first and the second. Here is the two scripts running side by side:
    https://i.postimg.cc/0NHht9k8/1st-an...n-vanishes.jpg
    As you can see, the change which I expect was wanted is that the remove and reistall App bloat pair has moved down. The Search tweak button vanished, probably by mistake I expect.
    https://i.postimg.cc/HLLf4rCZ/1st-an...n-vanishes.jpg
    I will take a geuss that a copy and paste went wrong. It certainly wouldn’t be the first time, Lol!
    Or, … I note also that Chris never discussed this new search tweaks button anywhere, so another explanation might be he wanted to remove it silently for some reason.



    Some big changes were done around the 23 September which included the windows update fix, many of the things for the new look bigger GUI, including the bloating out into it being too big
    Its close to just starting again, and a lot of that was discussed in the next normal size video, which at the time that I write this was the last normal size video specifically on the tool

    The Ultimate Windows Utility Upgrade 29 09 2021
    https://www.youtube.com/watch?v=dKM8ZScbic8
    Share ‘9.00 The Ultimate Windows Utility Upgrade-dKM8ZScbic8_29 09 2021.wmv’ https://app.box.com/s/9io0pbsjqmmkzfzep8fjqu09jr6lpmtd

    I started looking at scripts in detail at the time they were available from about November. Since the major change reflectes in this video from the end of September, the changes have been fairly well detailed either by Chris’s live stream videos or and my notes starting from the previous page about here: https://excelfox.com/forum/showthrea...e-Excel/page50

    a few extra notes a second time around,
    Chris seems keen to tell people to google debloat windows 10, to get his site at the top, and click there to get to his site.
    winget installs differently..( just to compare https://excelfox.com/forum/showthrea...ll=1#post16508
    https://github.com/ChrisTitusTech/wi...770ae56d3b6e85
    https://github.com/ChrisTitusTech/wi...b236f3ecf290db
    ) It installs through Microsoft Store, ( does not install the store)
    For full restore if something goes wrong with Essential tweaks , he says Undo first then system restore from the made restore point at start of essential tweaks
    He thinks a “local time” thing still in use since introduced as a temporary fix in the y2k time, is a bad idea, for example it might mess things up by Dual booting
    He is still not keen on disabling background apps
    Enable Hibernation button is there as Essentials tweaks disables it, - Chris thinks its better just to just restart your computer once a week.




    At the end of October a live stream added service tweaks and some old control panel type stuff
    9.05 Live - Redesigning the Windows Toolbox 29 10 2021
    https://www.youtube.com/watch?v=srvz8-5qReo
    https://drive.google.com/file/d/1zC3...?usp=drive_web






    The scripts and GUI from late September, are basically as in the above last screenshot form where I started looking at everything in detail, as it was happening or shortly after.

    So that’s about it,
    In the meantime I have just had my accounts at GitHub suspended.
    As ever, almost no one is interested in comments at YouTube.

    So it’s probably time to move on and do it all myself…



    A few miscellaneous things and notes

    A quick comparison of the GUIs. There a three main sorts
    First GUI, 04.12.2020 The Best Windows 10 Toolbox was the simplest 4 code lines, no colour code line so its at default
    Second GUI 06.07.2021 The Best Windows Utility came in all the crap that fucks it up later. But the color was a nice shade of grey, this code line does that
    $Form.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#b8b8b8") # Nice grey shade
    The third and current GUI , from The Ultimate Windows Utility Upgrade 29 09 2021 is the one with over sized and fucked up sizing. There is a color code line but the color is close to default
    $Form.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#e9e9e9")
    Here is all three together (on a 1920x1080 Screen Resolution )


    A way to fix that Admin warning: some settings are managed by your organization
    https://www.youtube.com/watch?v=dO30...zou9_7-HEna_4J
    Last edited by DocAElstein; 04-01-2022 at 11:26 PM.

  5. #5
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    slkhflskhfslkhf

  6. #6
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    From April 2022
    This is post
    https://excelfox.com/forum/showthrea...e-Excel/page52
    https://excelfox.com/forum/showthrea...ge52#post12786
    https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page52#post12786




    Its early April, 2022, and I am thinking about going outside for the summer to finish building my Bavarian castle. So I will tidy up my Debloat windows 10 script stuff, and forget about untill next winter

    Review where am I.
    In February/March 2022, I had to some repair work after strong storms, and watched a lot of videos learning PowerShell script.
    Chris did some updates on his Debloat script, and I finally found out how to get scripts from the time to match older videos. So I did a few more posts in the last two pages,
    _ Page 50, from https://excelfox.com/forum/showthrea...ge50#post12774 to get my script updated to Chris’s latest
    _ Page 51, from https://excelfox.com/forum/showthrea...ge51#post12780 to go again through the main Debloat videos with the benefit of having the actual scripts to which the videos were referring

    So I am was up to my version Temp6.ps1 , and my GUI looked something like this:


    _......So , moving on quickly, so I can switch the computer off until next winter

    _.____________________________

    Start with the GUI (size)
    I will take a finger in the wind guess, or estimate, a guestimate, based on all in my head, to try and start with approximately of what the final GUI should be like.
    An Idea might be to have it have things in it making it very wide, possible deep also, but to make effective use of the scroll bars, for example to “hide” things that should possibly not be used too recklessly, or things I am not so interested in currently.
    I will need to make the actual given size smaller. – That is just how it seems to work – set a smaller size than needed to hold all panes and other things you put in it.

    The height will be some average of all issues come across so far, something like, 600.
    I will start with about '800, 600' ( width , height )

    GUI better formatting, colours?
    I think I may have been a bit mislead by some Blogs and YouTube videos into thinking that the simple PowerShell script GUI is boring. Not true. PowerShell, unlike the simpler Shell cmd black window stuff, is somehow linked into the same Object orientated program stuff that Visual Basic is.
    I had an little initial fiddle with colours, and made a few other minor updates, and fiddles, taking my version to Temp7.ps1 , https://app.box.com/s/fttlmwny6y4s5ub1q66kvqbrw2ppxdwz
    jdklad

    Resizable GUI window and Scroll bar.
    A working scroll bar is no problem – one code line. A GUI is resizable as standard default.
    Just one subtlety , as mentioned before: If you want a scroll bar to always be there, as I do, you need to place things outside the window size. The script will not error if you do that. The things outside your given window size will need to be got by scrolling. Hence the scroll bar is there from the start.
    (If you had all things placed and dimensioned inside your main given GUI size window, then the scroll bars do mot apper at first. They will appear if needed, if you reduce the size ( by dragging right or bottom perimeters ) such that things no longer fit in.
    A convenient way to achieve what I want is to simply dimension Panels larger than the given GUI window size ( Panels are crudely similar to like GUI Windows inside, and fixed in, the GUI )

    So I have my Panels conveniently set to such a size such that they are like columns deeper than the set main GUI window size.
    For forcing the wider width, simple long comments or extended headings will do, as that is something I like generally in coding. Or alternatively stuff I might be experimenting with and/ or not sure I want to keep it there finally


    Results
    https://i.postimg.cc/ZKy0hPKC/Scroll...in-for-now.jpg
    https://i.postimg.cc/sfL18Hzk/Scroll...-red-stuff.jpg









    The next posts I do things in the next 6 Months a bit ad hoc, a few random things, progressing slowly when I feel like it..

    I might be a bit extravagant going up in version numbers. There might not be many changes from one version to the other, but text storage is very easy and cheap, and it’s a simple alternative to a GitHub version control catastrophe, in seeing where changes might have introduced problems!
    ( Thank god they banned me from GitHub, - I might otherwise of wasted my life trying to figure the place out. In the meantime Microsoft would have infiltrated it, if they haven’t already, and would be running the rest of my life, Lol ))











    Temp6.ps1 – Black and White - https://app.box.com/s/sn8dsqt237zffgkmjaqnvn7ewvqjdou8
    Temp8.ps1 - Colour - https://app.box.com/s/9b9li86s7dyysr7exdle30pckgp7vscz
    Last edited by DocAElstein; 04-02-2022 at 11:19 PM.

  7. #7
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    ISE v Microsoft Office VBA VB Editor
    I am very comfortable with the ISE, after I finally noticed it.
    After a bit of fiddling I find it almost as good as the VBA VB Editor.
    They look similar, and they are similar to a large extent

    Looking at that last screenshot, we could say to a first approximation, as a Layman explanation,…
    The PowerShell Window attached at the bottom of the ISE is similar in its working to the Excel Spreadsheet from which that VB Editor on the right belongs to ( You get that VB Editor up, from an open Excel spreadsheet, if you hit Alt+F11 ):…
    When you run the ISE script, stuff goes on from within that PowerShell window, even if that is less obvious ; When you run coding in the VB Editor, stuff typically goes on from in the Excel spreadsheet, which is often more obvious since the spreadsheet may be caused to change by the coding.
    Its all a bit more complicated than that, but that is a good initial Layman explanation.

    Subtle difference in debug step mode, ( running line by line) - workaround
    In the VB Editor its very easy. Click anywhere in the coding that you want to step through, then hit F8 and then each hit of F8 takes you to the next line, starting from the top
    ( If you want to start a bit further down, select the line you want to start from, hit F9, and that should cause that line to be highlighted in brown. ( That is called a stop point, ( you can also get it in the VB editor by clicking in the left margin where you want the stop point ) )
    Now first hit the play button or F5. That takes you as far as the brown line, ( the coding runs and stops at the brown line). Now proceed as before with F8 to step line by line further.
    A simple trick allows you to do the same in the ISE.
    The stop point works the same. Use it to set a stop point towards the start of the script, or from where you want to step through the script. So, for example, select the first script line and hit F9. The first line should now be highlighted in brown.
    After that it’s the same as with VB Editor, except use the F11 in when in the ISE, (rather than F8 as when in the VB Editor)

    ( If at any point during the stepping through, you want to continue from where you are normally:- it’s the same for both ISE and VB Editor: Hit the play button or F5. The code or script should then run normally from the point at which it ways when you do that )



    ( The difference in hoe ISE and VB Editor behaves here, seems to be a result of the PowerShell script needing to at least start running, even if you have it stopped at the start. This might explain why you get much better real time warnings of syntax errors as you write coding in the VB Editor. I will take a gauss that VBA somehow constantly does a quick run secretly as far as you are, or maybe its some sort of real time compiling, which I guess has the same effect )

    Note: The F9 is a toggle thing – so to remove a stop point, select that brown highlighted line, hit F9, and the stop point should be taken off, indicated by the brown highlighting vanishing.


    Ref
    https://www.improvescripting.com/how...shell-scripts/




    Adding code to existing script

    Adding code to existing script ( merging ) , ( in particular without changing line numbers or shifting existing code up or down )
    ( Example IP hosts block merge )
    This requirement is mostly just because I want to keep up to date with Chris’s stuff. So I don’t want to unnecessarily to shift things around too much.
    I have created space in which to add my new scripting, because I # commented out the script of Chris’s that I don’t use. But I would like to keep it there for future reference, and to help me keep up to date with his stuff without losing the orientation
    So that’s all well and good. No problem for adding a few code lines.
    But it’s a pain in the arse for adding longer script, because in order to keep Chris’s stuff I must paste in line by line in the space – you can’t paste multi lines in a space without losing all the stuff over to the right

    It’s not a major problem: VBA is very good for easily manipulating text files. It’s a bit off topic here, so over at these 3 posts
    https://excelfox.com/forum/showthrea...age8#post16366 https://excelfox.com/forum/showthrea...ll=1#post16366
    https://excelfox.com/forum/showthrea...age8#post16485 https://excelfox.com/forum/showthrea...ll=1#post16485
    https://excelfox.com/forum/showthrea...age8#post16491 https://excelfox.com/forum/showthrea...ll=1#post16491

    , I did some simple coding, using as a working example adding a long script to do the IP hosts block.

    ( Here the results: ' Temp7BeforeIPhostsInsert https://app.box.com/s/fttlmwny6y4s5ub1q66kvqbrw2ppxdwz
    https://i.postimg.cc/T2K3rjbC/hosts-Before-2022-04.jpg

    ' blockIPhostsRawAll250 https://app.box.com/s/7019x59uvvxt7osvb0tojr0z4g7bfdgk
    https://i.postimg.cc/pV3Xk9Yx/hosts-After-2022-04.jpg

    ' Temp8.ps1 https://app.box.com/s/9b9li86s7dyysr7exdle30pckgp7vscz
    )











    Temp8_02Apr2022.ps1 https://app.box.com/s/zz99n0yry1ssjs5wy3g0hj1qtwtpcnm1
    Last edited by DocAElstein; 04-06-2022 at 06:19 PM.

  8. #8
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    FAQs links on GUI
    Chris has a few links to specific videos. I will use that technique to link to my FAQs ( My FAQs start here, from around post 60 https://excelfox.com/forum/showthrea...e-Excel/page60
    https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page60
    )
    This bit, for example puts a wide red banner button, ( its just a wide button ).
    Code:
     $urlfixwinstartup = Create-Button -Text " !! READ FAQs!! Fixes&TWEAKs may help you take control of your computer, but you are responsible. RED CAN DO DAMAGE" -FntSz 8 -Width 700 -Height 20 -ClmX 100 -RwY 85 -FClr "#FFFFFF" -BClr "#FF0000"  #    #FF0000   is html red    #FFFFFF  is html white
    (The strange variable name is just because I used one of Chris’s button). I did not need to do anything else, except change the html on the Add_Click , ( https://i.postimg.cc/RFMBYNhM/Put-my...url-button.jpg ) , because of the existing script there from Chris


    This next one is completely mine. It puts a small Green button as for FAQs Main Tweaks
    Code:
     $urlMainTweeaksFAQ = Create-Button -Text "! FAQs MainTweaks" -FntSz 8 -Width 130 -Height 20 -ClmX 670 -RwY 205 -FClr "#FFFFFF" -BClr [color="#8C001A"]"#008000"[/color]   # #008000 is html Green 
    I had to then do some more steps
    _ a bit further down I added the variable to the Form Controls
    https://i.postimg.cc/C5tn1L0y/Main-T...m-Controls.jpg
    _ Further down again, I made the Add_Click
    https://i.postimg.cc/sXmCpsVv/My-Mai...url-button.jpg
    Code:
    $urlMainTweeaksFAQ.Add_Click({
    Start-Process "https://www.excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page60#post12965" 
    })
    Here the two buttons as seen on the GUI




    Last edited by DocAElstein; 04-05-2022 at 10:29 PM.

  9. #9
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    Code in Add_Click to function alternative
    In Chris’s script, the main meat of any Debloat tweak script, or install script, or any other thing done after clicking a button, appears in the code section within the .Add_Click , example:

    $winterminal.Add_Click({
    Write-Host "Installing New Windows Terminal"
    $ResultText.text = "`r`n" +"`r`n" + "Installing New Windows Terminal... Please Wait"
    winget install -e Microsoft.WindowsTerminal | Out-Host
    if($?) { Write-Host "Installed New Windows Terminal" }
    $ResultText.text = "`r`n" + "Finished Installing New Windows Terminal" + "`r`n" + "`r`n" + "Ready for Next Task"

    })


    That makes sense as the script within the .Add_Click is what is done when the button, ( in this case the button object variable $winterminal), is clicked by the user.

    But there can be advantages to call an external script from within the .Add_Click. For example, this would give better flexibility in use of the script: The script could then be called from other buttons or other script.
    This basic requirement, often done for convenience, is done by what is typically referred to in coding as a function or sub routine, which in simple terms is just a sub set of coding called from other coding

    Simple examples are perhaps the easiest way to explain this:
    This simple .Add_Click results in a text coming up when you click the button

    $okButton.Add_Click({
    Write-Host "Hello Shit World. Fuck off"
    })


    Using the function idea, that would be done with this

    function SayHelloToTheShitWorld {
    Write-Host "Hello Shit World. Fuck off"
    }

    $okButton.Add_Click({
    SayHelloToTheShitWorld
    })


    What’s going on.
    In simple terms:
    For the non function script, the script associated with the click, wrote a text. ( It was written into the PowerShell window belonging to the opened instance of the PowerShell/ ISE window in which the script is ( - in computer jargon: the script is hosted there in that window or PowerShell shell) )
    That is almost the same for the function case. The slight difference for the function way of doing it is that the script associated with the click sets off the script in the function SayHelloToTheShitWorld which is the same script as previously.

    Important positioning of the function in relation to other things:
    In PowerShell scripts things are not done as immediately as in some other languages. Things are generally done fir the first time, in sequence, as the script is run the first time. Not much is done before. Things tend to be stored the first time they are done or used or passed. They are then held in the memory of the open PowerShell until you close it.
    This has some consequences.
    _ ( Variables may have their type set the first time they are used, which can cause some unexpected results when developing or experimenting or debugging script during re runs. For this reason its often wise to include a command line towards the start of a script like this: Remove-Variable * -ErrorAction SilentlyContinue )
    _ The workings associated with a function are stored as the function is passed. So for our example to work, the function must go above the first time it is used, - so it would not work if placed below the .Add_Click
    _ ( Everything associated with the form is finally available after the form is shown. Hence often the last script line is some sort of .Show code line )
    _._____

    That concludes all we need to know. But in passing it my help get things more into a greater perspective appreciation if we explain the general function idea a little further. This may help avoid confusion later.
    On most computer work and languages, the most simple function version as we showed above would rarely be referred to as a function, rather a simple routine or sub routine. The word function would usually be used for a slightly more advanced form of the basic simple coding whereby something, typically a single variable or single object, would be returned, the specific details of which are a function of, ( or as a result of ) , other things given to the function
    This is a PowerShell script example that extends the previous example slightly:
    A single value is given, 0 or 1, ( in this particular case it could also alternatively be given as True or False ). Depending on what is given, a text may or may not tell you the time at which you used the function. ( As I present it here, I am passing a 0 , so the final texts that come out are
    ___Hello Shit World. Fuck off
    ___I used the function on ....I am not telling you

    Code:
    function SayHelloToTheShitWorld {param([Boolean]$WantDate)
    Write-Host "Hello Shit World. Fuck off"
    if ($WantDate -eq 1) {
    [string]$Hr=(Get-Date).Hour ; [string]$Mn = (Get-Date).Minute
    [string]$Rtn =$Hr + "Hour, " + $Mn + "minutes"
    return ($Rtn)}
    else {return ("....I am not telling you")}
    }
     
    $okButton.Add_Click({ #$vscode.location = New-Object System.Drawing.Point(4,797)
    $DateDone = SayHelloToTheShitWorld -WantDate 0 
    Write-Host "I used the function on $DateDone" 
    })
    A function of this sort may or may not do something itself other than returning something as a function of what it is given.

    The syntax may be a bit off topic for now, but just before we leave this introduction, lets do another function in PowerShell script that is more typical of a simple function example done generally in any introduction to function coding. This function returns a number, the value of which depends on the numbers given. Specifically it gives the sum of those numbers given.
    Code:
    function AddNumbers {param($Num1, $Num2, $Num3, $Num4)
    return ($Num1 + $Num2 + $Num3 + $Num4)
    }
     
    $Reslt = addnumbers -Num2 2 -Num4 3
    Write-Host "Result of summing numbers is $Reslt" # This is always done
     
    $Some.Add_Click({ #$vscode.location = New-Object System.Drawing.Point(4,797)
    $Reslt = addnumbers -Num2 2 -Num4 3
    Write-Host "Result of summing numbers is $Reslt" # This is done if you hit the Some button 
    })


    Share ‘functions.ps1’ https://app.box.com/s/7rmx2zsasymftrikjojjs3p3g1g8lng6



    An application of the function idea to my GUI version
    .
    Last edited by DocAElstein; 04-07-2022 at 09:44 PM.

  10. #10
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    slkhflskhfslkhf

Similar Threads

  1. Tests and Notes on Range Referrencing
    By DocAElstein in forum Test Area
    Replies: 70
    Last Post: 02-20-2024, 01:54 AM
  2. Tests and Notes for EMail Threads
    By DocAElstein in forum Test Area
    Replies: 29
    Last Post: 11-15-2022, 04:39 PM
  3. Replies: 39
    Last Post: 03-20-2018, 04:09 PM
  4. Notes tests. Excel VBA Folder File Search
    By DocAElstein in forum Test Area
    Replies: 39
    Last Post: 03-20-2018, 04:09 PM
  5. Replies: 2
    Last Post: 12-04-2012, 02:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •