slkhflskhfslkhf
Printable View
slkhflskhfslkhf
slkhflskhfslkhf
slkhflskhfslkhf
slkhflskhfslkhf
slkhflskhfslkhf
slkhflskhfslkhf
slkhflskhfslkhf
slkhflskhfslkhf
slkhflskhfslkhf
slkhflskhfslkhf
This is Thread Post 491 Forum Post 12766
https://www.excelfox.com/forum/showt...ge50#post12766
( link to youtube listings https://excelfox.com/forum/showthrea...ge42#post12685
https://excelfox.com/forum/showthrea...ge41#post12674
Link to last post on page 42 https://excelfox.com/forum/showthrea...ge42#post12693
Link to first post in page 43 https://excelfox.com/forum/showthrea...ge43#post12694
Link to first post in page 41 https://excelfox.com/forum/showthrea...ge41#post12674 )
Pull a Plonker #1
Microsoft Office, Bloatware?? – I doubt it
I might come back here when I have proved that the modification is necerssary. I don’t want to risk testing this yet, as if I am right and in testing I loose my Microsoft Office, then it can be a real pain to get it back: Despite having all the expensively purchased ( by me) disks with the Keys, Microsoft make virtually impossible to re install more than a couple of times.
In an earlier live stream video, around minute here and minute here , Chris mentions that he comments out the code line of
"Microsoft.MicrosoftOfficeHub"
so as to avoid deleting Microsoft office. On many other occasions he says following lots of request he is not going to delete it in any script of his. Never the less as I write this around Xmas New Year 2021 2022 , its constantly there in his scripts. Possibly its crept in since he is using GitHub to control his versions etc, GitHub IMO is worse than useless
I have left a few messages and replies to ask about this. I have had no reply and I don’t believe on badgering people who aren’t responding, as with people who are getting too many messages to cope, then it just fuels the situation and makes it worse.
So this Pull a Plonker #1 is doing this
# "Microsoft.MicrosoftOfficeHub"
Pull a Plonker #2
Push Pull Plonker WAP Properites Telemetry ( "DiagTrack" "dmwappushservice" stuff )In this YouTube video at minute 1, Chris talks about disabling a couple of services, https://youtu.be/yXaYszT11CA?t=60
I expect that these code lines are the implementation of this in
All well and good.Code:
Write-Host "Stopping and disabling Diagnostics Tracking Service..."
Stop-Service "DiagTrack" -WarningAction SilentlyContinue
Set-Service "DiagTrack" -StartupType Disabled
Write-Host "Stopping and disabling WAP Push Service..."
Stop-Service "dmwappushservice" -WarningAction SilentlyContinue
Set-Service "dmwappushservice" -StartupType Disabled
But in a later Live Stream video, Redesigning the Windows Toolbox, streamed live on Oct 29, 2021 he added a script bit a bit further down to set a few services to Manual, including these two.
So either those later two lines ( in # Service tweaks to Manual ) need to be removed, or the above bit should be removed.
For now I will take out the later lines thus
There is also a possible issue with the Undo Essential Tweaks not putting these back exactly as they were. But maybe I will look at that later ( https://eileenslounge.com/viewtopic.php?f=18&t=37712 )Code:# Service tweaks to Manual
$services = @(
"diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service
# "DiagTrack" # Diagnostics Tracking Service https://i.postimg.cc/ZK23pZyY/Services-MSC-Telemetrie.jpg
"DPS"
# "dmwappushservice" # WAP Push Message Routing Service (see known issues) https://i.postimg.cc/t466zfh3/dmwappush.jpg
Edit later Looking at this issue of the Services, Getting at them, it seems that
_ you will need PowerShell 7._ to do anything with
Start up Type AutomaticDelayedStart http://www.eileenslounge.com/viewtop...292019#p292019
http://www.eileenslounge.com/viewtopic.php?f=18&t=37740
See also here
https://excelfox.com/forum/showthrea...ge51#post12777
This is post https://excelfox.com/forum/showthrea...ge50#post12767
https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page50#post12767
Pull it Plonker #3
Chris Fucked up a simple change because he was poxing about in GitHub Crap, ( or I am just a jerk for not understanding GitHub yet.. )
#3a Seems to work
Disclaimer: I might be talking crap here, because I don’t understand GitHub. On the other hand GitHub could be a complicated waste of time, worse than useless, and it can cause you to mess up a simple change like adding a couple of lines to a script and trying it out.
Simplified shortened story:
Someone called nikilson suggested way back in early December a change, basically comprising two code lines to stop the web search being suggested when you search in that small search bar bottom left, https://github.com/nikilson/win10scr...e09a7125868e92
So before using those code lines you might have this
https://i.postimg.cc/VNqwtH0M/bollox...web-search.jpg https://i.postimg.cc/rynk54sh/Bollox-to-Web-Search.jpg https://i.postimg.cc/2SvNpXwJ/Bollox-to-Web-Search.jpg
But if you run a couple of lines like this, either alone or in the full Debloat script, .._
_.. , and then the web search bollox is goneCode: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 "AllowSearchToUseLocation" -Type DWord -Value 0
https://i.postimg.cc/sxXCtj69/No-bollox.jpg https://i.postimg.cc/sDMRm2Z3/Gone-B...Web-Search.jpg
I have tested that on several computers on a few different Windows 10 versions, including the latest windows 10 version, 21H2. It seems to work, as does the corresponding undo code lines to put it back
Code:Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "AllowSearchToUseLocation" -Type DWord -Value 1
Pullock #3b
In this live stream video, https://www.youtube.com/watch?v=ZEW5f7F94FY
9.23 Live - Updating all my GitHub Projects - The Power of FOSS 31 12 2021 https://drive.google.com/file/d/1A29...?usp=drive_web
, Chris had an attempt at testing the “Pull”:
At about minute 11, 37 seconds, https://youtu.be/ZEW5f7F94FY?t=697 , he started looking at it, at about minute 23 , https://youtu.be/ZEW5f7F94FY?t=1380 , he put it in some abstract branch twig test GitHub crap, and forgot about it and closed the “Pull request”
At about minute 57 , https://youtu.be/ZEW5f7F94FY?t=3430 , to fill up time while waiting for something, he tried to test the thing. He ran a Windows 10 virtual machine, and called up the script from the one command thing. As I understand it that runs the current ps1 script somehow across the internet. But Chris never changed that script, ( other than adding a simple single Debloat line HotspotShieldFreeVPN )
Instead, after adding that simple single Debloat line he …. Before we grab any more requests we will make another branch - ( minute 7 and 30 seconds https://youtu.be/ZEW5f7F94FY?t=450 )
I think the problem is when pissing about with virtual machines and catastrophic GitHub, you easily loose track of reality. It might look pretty on a video, but to get the job done quickly and efficiently it is very simple:
_ you can pick up older machines with the older software versions very cheaply. I think anyone working on developing things in windows 10 should have a few computers.
_ simply test the code lines directly in PowerShell or Windows PowerShell ISE or in a copy of the script.
The code lines do what they should. Chris was a Branch Test Pullock when he thought he tried them out, ( or I am the slow to get the point idiot, again..)
Plonky Wonk 4 / 2b
Issues with the Service syntax differences PowerShell 5.1 to 7.1http://www.eileenslounge.com/viewtop...292019#p292019
http://www.eileenslounge.com/viewtopic.php?f=18&t=37740
Set-Service "dmwappushservice"
We cant set it back to StartupType AutomaticDelayedStart in PowerShell 5.1. We need PowerShell 7.2. (PowerShell 7.0 and above is a separate install from the built-in PowerShell https://eileenslounge.com/posting.ph...&f=18&p=292019 )
Chris doesn’t seem to make any attempt to do anything with it in Undo Essential Tweaks)
This is post https://excelfox.com/forum/showthrea...ge50#post12769
https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page50#post12769
Pulling my Plonkies 5+
Bollox, it would be easier to start again from scratch
I have come to a bit of a turning point. Mostly because just now I don’t yet have infinite time available.
- I got a lot more I want to do this winter.
Intro. Why am I writing my own script / developing
I would not have got this far, or no where near as quickly without Chris’s stuff. I remain very grateful to him.
But its got to the point that his chaotic organising and lack of him having time currently to do justice to the replies, and suggestions that he gets, coupled with the failings of GitHub and YouTube, ( In particular it being almost impossible to comment on YouTube without it being deleted since last July https://support.google.com/youtube/t...comments?hl=en
GitHub is deigned I think to mess up a project, by not only losing all control, but actively messing up all version control. GitHub is the Devil ) … All this means that at the end of the day, its going to be a lot quicker for me to start again from scratch myself.
His script is full of errors, redundant code and other failings and getting that info across to him has improved to be impossible.
But he is still a great guy, and I love him!
But I gotta move on….
I think this post I am writing in will turn into a table of contents for the next posts
GUI Redesign Post https://excelfox.com/forum/showthrea...ge50#post12770
I quite like the GUI idea. It’s convenient. But it’s aimed not to entertain but instead be practical. It is. Its square with simple square labelled button in it. It just need a few simple code lines, a few code lines are needed just once, some others are either in
_ a loop
Or
_ repeated.
Chris likes to use Posh GUI software to make and control developing/ adding to his GUI. I expect that is due to some reasons such as it looks nice in a YouTube video and other reasons I don’t know.
But its like swatting a fly with a nuclear missile. It makes a code I expect by recording what you do, just like the VBA macro recorder, you then get a lot of stuff repeated, which then a programmer would reduce into more efficient looping coding or make a function to do similar things in the same coding.
Personally I don’t mind the extended inefficient text, as text is cheap and it makes it easier later to do mods on a particular button later.
But I am going to do some looping to do the repeated stuff to get the buttons there,
mostly because
_ I want to reduce the code lines, so that I have room to add my new coding but keep some of Chris’s stuff approximately where it is, even if I then #comment it out, as I would like to still follow later what Chris is doing.
_ Its gonna help me “migrate” from modifying and rearing Chris’s script to having a completely new one of my own
This is post https://excelfox.com/forum/showthrea...ge50#post12770
https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page50#post12770
Plop #495a)
A GUI, simple square with a few square buttons, based on a few simple code lines and a bit of looping
5a) Introduction.
The thing is like approximately like box with 4 columns of buttons. I might leave it in that form, or add a column or two and move things about a bit.
The outer window box GUI form thing that comes up:- It’s too dammed fucking big, Chris
I’ve told him dozens of times so has others. I think he is oblivious to the fact that for most people it blots out the screen making lower buttons unusable. Chris often waffles some crap about automatic re sizing, but I expect he just has some code generated by Posh GUI, which possibly has some redundancy in it, as well as other issues, which he does not understand.
So bollox to all that. It just takes a few simple code lies to make a simple square that will conveniently fit on most peoples screens. About half the size of what he usually has is ideal, but I will use about two thirds as then I can still see a lot of his buttons on it as I migrate from his coding to my new coding.
The buttons
For each button we have a variable of object type. Most of the properties are defined in one go to the variable, (assigned to the variable), but the Click is Added ( the coding that does something) somewhere else. There might be some reason for that, or it might once again just be how Posh GUI chucked it out.
All the buttons are very simple wide rectangular ones and could all be done in a loop. This has been suggested and written for Chris a few times, but he’s not interested as he like his posh GUI.
( jumbled in this section we also have 4 “panels” which for want of a better description seem to be a invisible button with nothing in it, - something like a range, or range object. These 4** are tall things a bit wider than most buttons and extend to the area a bit bigger than to accommodate one of the 4 columns of buttons
A bit further down we add things, that is to say the corresponding buttons, in these column ranges.
The actual Form itself seems to act like a range, or can be used as such, so we actual Add the variables to 5** ranges in total.
We do this Form Controls AddRange first and amongst other things, then add the 4 column Panels to that first. I suppose that makes some sort of hierarchical OOP relesense.
Generate some stuff with a function.
As I mentioned previously, I expect the GUI generated coding, as typical from such stuff, gives all things and does not have the sense to group similar things, or come up with something like a single function talking arguments, to do the similar stuff repeatedly. So a lot of stuff is repeated. I am actually untypical in preferring that usually, but I am going to tidy stuff up with a function to give me some spare lines to put my stuff in, whilst keeping some of Chris’s stuff , albeit mostly commented out, for later ease of navigating around his later modifications.
Etc. etc..
5b) GUI redesign. GUI code Debloat
_5b) A few obvious minor issues in Chris’s code..
The Problem/ Characteristic/ Feature/ Reality.
The GUI, and the use of it in Posh GUI looks great and big and great and awesome in a YouTube Video.
That’s good enough reason to use it. Chris will and that’s fine by me. All power to him and his YouTube stuff. He has saved me loads of time.
Post GUI totally fucks up code development. (Use GitHub and the disaster is complete)
I think its designed to be like the VBA macro(code) generator. It pukes out code for what you do, and / or what you end up with.
It’s helpful to get you started, but Nothing else in code development. Inevitably you end up with repeated, redundant, contradicting, inefficient coding. Even worse if you continue to use it. It just bloats up to a ridiculous amount.
A few obvious minor issues in Chris’s GUI related code…
The GUI come up too fucking big.
_ The .AutoSize = True and .AutoScroll = True are a bit contradictory and cause it to bloat up, and if occasionally the scroll bar appears, it usually vanishes. Its unstable. The .AutoSize = True needs to be removed.
_ There seems to be two lines to size the GUI. They have the same dimensions. They are a bit different but I expect either one will do
_ I think Chris sees it at a size that, on average, is a bit smaller than most people see it. I think he uses , on average, a higher screen resolution, which somehow seems to effect the GUI size in his messed up coding. Instead of two code lines giving the dimension of '1050, 1000' , perhaps the simplest of the two with '800, 600' is about right for most people
_ Some other code lines may have been puked out by Posh GUI and aren’t needed, I am not sure. Some things will be at the default value, and the code lines will reflect this. I probably would not delete those lines as they could be useful to use later if I want to try out non default values, but I would #comment them out.
Here are the sane code lines for a simple GUI. It will come up in a convenient size, has a scroll bar and you can resize it
Anything else is bloatCode:Add-Type -AssemblyName System.Windows.Forms
$Form = New-Object system.Windows.Forms.Form # Create a new form
$Form.ClientSize = '800, 600' # Define the size
$Form.AutoScroll= $True # Adds a scroll bar if needed – example if You have added panels ( ranges ) bigger than the size
$Form.StartPosition = "CenterScreen"# Personal choice if you want it to come up middle screen
[void]$Form.ShowDialog() # Display the form
https://i.postimg.cc/tgH3rXR0/Simple-GUI.jpg https://i.postimg.cc/Y2yQ5N2z/GUI-comes-up.jpg
https://i.postimg.cc/HrB8n173/Simple-GUI.jpg
_.__________________________________________---------
( I am not sure what these two lines do either , other than fuck things up a bit more
$Form.Width = $objImage.Width
$Form.Height = $objImage.Height )
See also here:
GUI Too Fucking big https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page43#post12697
https://excelfox.com/forum/showthrea...ge43#post12697
_5c) making Buttons (The function to make buttons issue….)
Its good programming practice apparently to loop similar things rather than having a long list. I don’t personally subscribe to that, not being a good programmer, and most likely never wanting to be one. Most programmers seem a bit screwy, - from harmlessly a bit weird to seriously narcissistic Psychos.
Text is cheap, so leave it all in I say, preferably in approximately the order you see stuff. Makes it easier to modify individual things, if you want to make it very irregular / diverse, like a dashboard , later.
But:
_(i) This is most likely gonna stay very simple – a GUI box with simple buttons on it.
_(ii) I would like to make myself space, as I would like initially to keep Chris’s stuff there so as to keep up to date and future reference and comparison with what he is doing
Currently Chris’s code has, for the buttons, a whole lot of repeated crap like this:
That makes one buttonCode:$defaultwindowsupdate = New-Object system.Windows.Forms.Button
$defaultwindowsupdate.text = "Default Updates"
defaultwindowsupdate.width = 160
$defaultwindowsupdate.height = 21
$defaultwindowsupdate.location = New-Object System.Drawing.Point(162, 2)
At least one chap, A1ex N , has shown Chris how to do that in a function https://github.com/ChrisTitusTech/wi...diff=split&w=0 .
Chris hasn’t really had time to look at them, and is probably gonna keep using his Posh GUI to generate crap on top of crap. It looks good on video, that’s all.
It’s not difficult to write such a function. I wrote my own function, after a quick look at what A1ex N did.
Having done that function, then a single following code line of this form will "make" a single button. In other words the following does the equivalent of that previous button code exampleCode:# Function to creat button - idea from a "Pully" thing https://github.com/ChrisTitusTech/win10script/pull/140/commits/cebd4effb84152b04603cbebe14bc63b2770b0b6?diff=split&w=0
function Create-Button {param([string]$Text, [int]$FntSz, [int]$Width, [int]$Height, [int]$ClmX, [int]$RwY)#As Object # This function allows us to make a buttons in one line. (Those later single lines do not make the button appear
$Btn.Text = $Text
$Btn.Width = $Width ; $Btn.Height = $Height
$Btn.Location = New-Object System.Drawing.Point($ClmX, $RwY)
$Btn.Font = New-Object System.Drawing.Font('Arial', $FntSz)
return $Btn }
That is not quite the full final story. Some of the following final steps could also be tidied up with a function. But I don’t bother: In fact putting all the short commands on a single line makes it look very similar to if I had done a function…Code:$defaultwindowsupdate = Create-Button -Text "Default Updates" -fntsz 11 -Width 160 -Height 21 -ClmX 162 -RwY 2
"Pinning" the buttons somewhere
Although the argument syntax of the button has those location parameters, _ 162, 2 _ , they are not yet referring to anywhere. It might be a reasonable Laymen thought that they are automatically referring to somewhere in the GUI. But it just doesn’t work like that. There is no reference to the GUI specifically. One good reason for that will be soon obvious.
We could just make the co ordinates refer to the GUI box like this
$Form.controls.AddRange(@($defaultwindowsupdate))
The convention would then be that the co-ordinates refer to 0, 0 being at top left of the GUI. In this example we would be 162 across to the right from top left of the GUI and 2 down, from top left of the GUI. So we could do that, - but we usually don’t …_
Panels
_... its usually more convenient to split the GUI into "Panel"s, which as the name suggests are areas, rectangular, and we put a group of things such as a set of buttons, for example those related to similar things, in. This is more for convenience than anything else. We could for example change the location of a panel which would then automatically move all those buttons in one go.
The way that works then is that you
_ make the Panels
_ Use the code line of the form $Form.controls.AddRange(@($Panel1, $Panel2, ……….)) to put the Panels rather than the buttons in the GUI, ( The which itself could be regarded as a Panel )
_ Finally, the buttons would be added to their respective Panel with similar , $Panel1 .controls.AddRange(@($Panel1, $Panel2, ……….)) , $Panel2.controls.AddRange(@($Panel1, $Panel2, ……….))
, …etc.. code lines
Here’s the current code lines, which I will probably change them a bit over the next few posts. Chris used 4 main column Panels. I have currently 5 column panels and another smaller panel somewhere around middle / top right.
Code:$Panel4 = New-Object system.Windows.Forms.Panel ; $Panel4.height = 60 ; $Panel4.width = 350 ; $Panel4.location = New-Object System.Drawing.Point(380,25) # around top right / middle top
$Panel2B = New-Object system.Windows.Forms.Panel ; $Panel2B.location = New-Object System.Drawing.Point(550,50) ;$Panel2B.height = 938 ; $Panel2B.width = 120 # 5th column # $Form.Width = $objImage.Width
$Panel2 = New-Object system.Windows.Forms.Panel ; $Panel2.location = New-Object System.Drawing.Point(420,50) ;$Panel2.height = 938 ; $Panel2.width = 120 # 4th column # $Form.Height = $objImage.Height
$Panel3 = New-Object system.Windows.Forms.Panel ; $Panel3.location = New-Object System.Drawing.Point(250,50) ; $Panel3.height = 939 ; $Panel3.width =200 # 3rd column
$Panel1 = New-Object system.Windows.Forms.Panel ; $Panel1.location = New-Object System.Drawing.Point(0,50) ; $Panel1.height = 939 ; $Panel1.width = 120 # 1st column
$PanelB = New-Object system.Windows.Forms.Panel ; $PanelB.location = New-Object System.Drawing.Point(125,50) ; $PanelB.height = 939 ; $PanelB.width = 120 # 2nd column #$Panel1.height = 939 # 939
$Form.controls.AddRange(@($Panel10,$Panel1,$PanelB,$Panel2,$Panel2B,$Label3,$Label15,$Panel4,$PictureBox1,$Label1,$Label4,$Panel3,$ResultText,$Label10,$Label11,$urlfixwinstartup,$urlremovevirus,$urlcreateiso))
$Panel1.controls.AddRange(@($PS,$PS7_2,$notepad,$firefox,$gchrome,$mpc,$vlc,$powertoys,$winterminal,$vscode,$Label2,$everythingsearch,$vscodium,$imageglass,$gimp,$Label7,$Label8,$Label9,$advancedipscanner,$putty,$etcher,$translucenttb,$githubdesktop,$discord,$autohotkey))
$PanelB.controls.AddRange(@($brave,$7zip,$sharex,$adobereader,$vlc,$powertoys,$everythingsearch,$sumatrapdf,$imageglass,$gimp,$Label7,$advancedipscanner,$putty,$etcher,$translucenttb,$githubdesktop,$discord,$autohotkey))
$Panel2B.controls.AddRange(@($darkmode,$performancefx,$lightmode,$essentialundo,$EActionCenter,$ECortana,$RBackgroundApps,$HTrayIcons,$EClipboardHistory,$ELocation,$InstallOneDrive,$WarningLabel,$Label5,$EHibernation))
$Panel2.controls.AddRange(@($RestorePt,$essentialtweaks,$0andOShup,$TeleRegTweaks,$servicetweaks,$backgroundapps,$cortana,$actioncenter,$darkmode,$onedrive,$lightmode,$removebloat,$WarningLabel,$appearancefx,$STrayIcons,$dualboottime))
$Panel3.controls.AddRange(@($yourphonefix,$Label6,$windowsupdatefix,$ncpa,$oldcontrolpanel,$oldsoundpanel,$OldSystemPanel,$reinstallbloat)) # MissingEndParenthesisInSubexpression
$Panel4.controls.AddRange(@($defaultwindowsupdate,$securitywindowsupdate,$Label16,$Label17,$Label18,$Label19))
Current stand. Last remnants of Chris’s coding
The uploaded file is Chris’s script, messed around a lot with a few other things added
I did it as part of my PowerShell scrip learning.
But its still useful for future Re reference as I want to continue to follow Chris’s work and contribute if I can, to help.
On the next page, or more likely the over next page, #52, I will start from scratch I think
The rest of this page, #50, and most of the next page, #51, will probably be used for notes on
_ a few issues I might try to get across to Chris,
and/ or
_ just general issues related to further development of mine and Chris’s script
This is what that code will bring up
https://postimg.cc/Lqfq6kxH https://i.postimg.cc/pdcKCq8n/Last-C...script-GUI.jpg
Attachment 3827
https://i.postimg.cc/pdcKCq8n/Last-C...script-GUI.jpg
This is typically how it come up on screens with resolution 1366x768 and 1440x900
https://i.postimg.cc/RCfDbDyz/Temp4-ps1-1366x768.jpg https://i.postimg.cc/65f1BGBj/Temp1-in-1440x900.jpg
https://i.postimg.cc/pyWCmqP0/Temp4-ps1-1366x768.jpg https://i.postimg.cc/Yhjx30GY/Temp1-in-1440x900.jpg
Share ‘Temp2.txt’ https://app.box.com/s/t7utchjkhoxto56tqtnbx9f4vovav5r8
Share ‘Temp2.ps1’ https://app.box.com/s/un0oxan387v5azqb7t18yu0lu87k2v97
This is post #499 https://excelfox.com/forum/showthrea...ge50#post12774
https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page50#post12774
So at about the start of February, I was thinking of starting my own Tool from scratch, looking something like the pics from the last post. But I went off to learn PowerShell script a bit better, and do a few other things until about mid March.
Chris updated a few times during this period, so this post is a History to keep me in touch. I may not add the things or changes Chris made. But I may adjusts my lines to , for example add spaces where he inserted stuff. This is so I can still relate my script to his in the future..**
Friday, 11 Feb., 2022 Update
On the Friday, 11 Feb., 2022, Chris did his Live stream on the Tool, … 9.30 Live - Toolbox Update - New Features (Disable_Enable Updates)-WRg5nItpghA_11 02 2022
https://www.youtube.com/watch?v=WRg5nItpghA
https://drive.google.com/file/d/1kNQ...?usp=drive_web
https://drive.google.com/file/d/1khe...?usp=drive_web
I have taken my last temporary file up to Temp 4, Temp4.ps1 , to take account of this. But I am not adding the changes, but rather just adding spaces so that my code lines are approximately the same.**
Notes on these spaces and the generally current code stand follow
At the same the time, the following notes give a general review of the code from Chris, now a bit further on, before I write the whole thing from scratch. Basically the 11 Feb Live video came out while I was about to start my new from scratch script
So I am combining a general review of the current stand of Chris’s code, win10debloatChris12Feb2022.ps1
Share ‘win10debloatChris12Feb2022.ps1’ https://app.box.com/s/5lfgt22pqtly1g127ubnybj6ltn3j1x3
, with my latest, Temp4.ps1
Share ‘Temp4.ps1’ https://app.box.com/s/y291ha4eb906v7lkvd8ehzz9ii70cvoh
Chris playing with his PoshGUI( 53:30 … don’t hate me for it! https://www.youtube.com/watch?v=WRg5nItpghA&t=3210s )
Chris was playing with his PoshGUI again.
Looking at what he does… I think as you put buttons on an existing thing that it will make the variable with the name you give it ( by default it will give you button1 , botton2, button6 etc.. as available, - as you re name it, then that default name, button1 , for example is available to poshGUI to use). I expects poshGUI will then automatically add that bloated button layout bit, and add appropriately the reference in the adding variable in the pane code lines.
The $kkjash.Add_Click bit you do yourself, ( before or after ) but if you do it after, some intellisense offers the .Add_Click for it, amongst other things, when you write in the variable $kkjash.somewhere.
The stuff you put in the $kkjash.Add_Click is the real meaty stuff that does anything. If Chris was doing this for himself, in his day job, he would just have all that meaty stuff and run that as he wanted
So, This is a generally summary of mine since/ just after Chris’s, and the Live video
Up to about 30 is some crap bloat, and the winget bit, then the Form is finished
at about 40 and then we are mostly into the large repeated GUI produced button bloat
To allow for 4 new buttons and a warning label made by Chris in that video, I make a big space from approx 620 – 650 , which pushes the small number ( 5-7 ) of Form Pane lines up to approximately 660
So these 4 bloat button bits and a label is what posh GUI did
$NFS
$laptopnumlock #( ------ *** )
$disableupdates
$enableupdates
$Label12
That got added to the large form button repeated bloat section taking us to approx 860
Me or Chris has got a line or two out of step, but we are approximately together, 866-867 Essential Tweaks starts, ……….._
_........
_.... ( with service tweaks starting at about 1056-1058 )
As far as I can see, that Edge Bing start up tweak, ( https://github.com/nikilson/win10scr...e09a7125868e92 )
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\S earch" -Name "BingSearchEnabled" -Type DWord -Value 0 ; Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\S earch" -Name "AllowSearchToUseLocation" -Type DWord -Value 0
, is still missing, ( Chris , I think, meant to put it just after end of services/essential tweaks … ( https://excelfox.com/forum/showthrea...ge50#post12767 ) )
I have Essential Tweaks split up a bit. But we are finishing approximately together at 1156-1157
We both have a dualboottime Add_Click and then I have made a space for a laptopnumlock which came in from Chris on the 11th Feb. He seemed to think it should have been there and he had forgotten it. ( *** Chris actually then duplicated a Add_Click which was already there- so he had just missed the button previously. )
So we both start the essential undo at 1173. At this stage I have not split or changed any essential undo so we finish that at 1286.
1288 – 1371 We then have a very large $windowssearch Add_Click which does not seem to have a button?? ( It has a short #commented out Cortana disable section )
A short $backgroundapps Add_Click then
1383 _
__– 1404 A fairly large disable Cortana
1406- 1496 The Bloatware array
1497 – 1522 Button pair: removes and re ad bloat ( MS Store Apps )
1524 – 1563 Button pair: default updates or the security only
Up to about 1895 is mostly all other buttons used on script until the 11 Feb redesign, (*** and I note a strange $DisableNumLock Add_Click is a duplicate of the added on Feb 11 $laptopnumlock [ Laptop Numlock Fix ] ***
Chris also slipped in the $NFS .Add_Click at 1790, so I have a space from 1790 to 1802
1897 – end ( 2069 ) button pairs which were main theme from 11 Feb. $disableupdates .Add_Click $enableupdates .Add_Click
So for mine I have a big space from 1897 – 2069
Summary
There is a very short GUI bit at the start that Chris never seems to go near anymore . This makes a meal of the very simple few lines that make a form, and fucks it up.
The rest is all ( except for the meat behind the buttons, ( the $hfvafh Add-Click stuff ) bit ) all dome by PoshGui in a terribly jumbled up way.
It’s so jumbled and messed up, that Chris often screws up putting the meaty bits in.
win10debloatChris12Feb2022.ps1 https://app.box.com/s/5lfgt22pqtly1g127ubnybj6ltn3j1x3
Temp4.ps1 ’ https://app.box.com/s/y291ha4eb906v7lkvd8ehzz9ii70cvoh
Here is a few minor issues, which I might try to get across to him
Num Lock chaos issue https://www.youtube.com/watch?v=WRg5...P1d2B994AaABAg https://www.youtube.com/watch?v=WRg5nItpghA&t=2210s
At minute 36:50 he noticed by chance when doing something else, that some time previously he had missed a Disable NumLock after startup button and coding, so he made one , $laptopnumlock
( https://www.youtube.com/watch?v=WRg5nItpghA&t=2210s )
629 $laptopnumlock = New-Object system.Windows.Forms.Button
630 $laptopnumlock.text = "Laptop Numlock Fix"
631 $laptopnumlock.width = 211
632 $laptopnumlock.height = 30
633 $laptopnumlock.location = New-Object System.Drawing.Point(4,267)
643 $laptopnumlock.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
1164 $laptopnumlock.Add_Click({
1165 Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 0
1166 Add-Type -AssemblyName System.Windows.Forms
1167 If (([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) {
1168 $wsh = New-Object -ComObject WScript.Shell
1169 $wsh.SendKeys('{NUMLOCK}')
1170 }
1171 })
In fact he had only forgotten the GUI button, the Add Click coding was there
1751 $DisableNumLock.Add_Click({
1752 Write-Host "Disable NumLock after startup..."
1753 Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 0
1754 Add-Type -AssemblyName System.Windows.Forms
1755 If (([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) {
1756 $wsh = New-Object -ComObject WScript.Shell
1757 $wsh.SendKeys('{NUMLOCK}')
1758 }
1759 $ResultText.text = "`r`n" +"`r`n" + "NUMLOCK Disabled"
1760 })
He is still screwing up the GUI size, I did a few comments again at YouTube. Most got deleted, as did late a lot of very helpful posts I did at GitHub
Commit 17 Feb 2022
Chris added some Virtual thing that I don’t understand yet. He did a video on 19 Feb.
Apparently it is already there in Windows Pro, so he has a button in his troubleshoot section. So I guess the script he added behind the button does some of what you would do get the thing up and running.
So I will do a simple Temp4.ps1 to Temp5.ps1 , making spaces so that Temp5.ps1 has the same line positioning of most stuff as this
win10debloatChris17Feb2022.ps1
https://app.box.com/s/fajb84rq6x2dz9vl0a6dhgbj8l5t8xku
So we need to shift down some lines in mine from 657 for the button to the form:
https://i.postimg.cc/Y23rjBBP/Shift-down-from-657.jpg
and
similarly for the coding behind the button, my Temp5.ps1 has the start line for the code behind update fix button, $windowsupdatefix.Add_Click({ , shifted down to 1826
https://i.postimg.cc/VLkYCZYk/update...wn-to-1826.jpg
That appears to be all I need to do, but while I am here……
I seem to have not made the end space at the end for the 11 Feb enable and disable update meat behind the button stuff? - I am not sure if that was intentional, or whether that got truncated accidentally somehow.
So going backwards up the script, I put some comment lines in to keep it in wach.
https://i.postimg.cc/6p6YwRLS/adding...dded-by-me.jpg
https://i.postimg.cc/P5Fzj7qp/adding...dded-by-me.jpg
https://i.postimg.cc/zGMWMRdT/adding...dded-by-me.jpg
In fact as a very last action for Temp5.ps1, I added some similar comment lines to help me orientate in the future to things added by Chris but not yet added by me.
https://i.postimg.cc/YSzrF5mj/adding...dded-by-me.jpg
https://i.postimg.cc/4yhj6cFw/adding...-yet-added.jpg
https://i.postimg.cc/j51GncvL/adding...-yet-added.jpg
https://i.postimg.cc/0NVgPPwG/adding...t-added-by.jpg
https://i.postimg.cc/Y905SZ65/adding...added-by-m.jpg
https://i.postimg.cc/6TJgYQkK/Chriss...king-lines.jpg
https://i.postimg.cc/7YSZDJYg/Consol...everywhere.jpg
https://i.postimg.cc/K8FvYcRC/Consol...everywhere.jpg
https://i.postimg.cc/QN2dRJs8/Consol...everywhere.jpg
( Just one last thing. I #commented out the default winget install at this Temp5.ps1 stage, just because I want to do some testing later on virgin machines which involves investigating if this is done. I don’t want to do that currently )
https://i.postimg.cc/9X7Wtw9v/Tempor...-temp5-ps1.jpg
Temp5.ps1 https://app.box.com/s/vp8sdqoducp6rn1yj4dsb7edinasdjlf
win10debloatChris17Feb2022.ps1 https://app.box.com/s/fajb84rq6x2dz9vl0a6dhgbj8l5t8xku
Chris got a bit ahead of me again, so here another update, going to my Temp6.ps1 from his version of around the 10-16 march, ( Commit 10 March, I took a copy on 16 March)
Commit 10 March 2022 Power options added
Main changes are
_ a bit of reorganising of wording and buttons in the area of tweak, troubleshoot, fixes, and moving of Windows Update Reset button https://i.postimg.cc/FsQNtjzv/Temp5-...on-changes.jpg
_ addition of two buttons , Restore Power Options and Win7 Power Panel, ( and I note here that in a recent video Chris noticed that he may have some duplicated stuff issues to take care of , https://youtu.be/KjHfCDPfLdI?t=153 ,
https://excelfox.com/forum/showthrea...ge43#post12702 )
( He seems to be referring now to Old jashdkjadh Panel stuff now as Win7 jashdkjadh Panel
Putting things back into wach, that is to say some constancy in code line numbers between mine and Chris’s script , is a bit difficult for me in some places as Chris has taken out a bit of stuff, in places where I had an empty space**, ( all be it by the virtue of shifting some of his bloat in comments to the far right. So I would be working a bit blind).
**This could cause problems if I have used these spaces for new things that I have added, I will need to be careful of this.
I need to do this by first seeing the difference to lines in his February and March versions that I have, at least initially in the Label area
( One important thing to note here is that Chris may** have gone against his own religiously held rule of messing with the script parts given by his PoshGUI (** He may have not if he did the changes on the PoshGUI )
To assist me I will make an in-between help file, based on a modified version of the script that was available from around 15-17 February
The unusual changes involving removing lines
_(i) Taking out $Label4 “Troubleshoot” = remove 8 lines , 293-300
_(ii) Taking out $Label6 “Misc Fixes” = remove 8 lines , 426-433
I remove these lines and save the modified script as win10debloatChris17Feb2022Bee.ps1 So this new ps1 File will be a modified version of the script that was available from around 15-17 February
The more usual typical changes as a result of things being added
_(iii) Adding a $oldpower button and $restorepower button requires adding in total 14 lines from 649.
For later reference I will add comments
649 # $oldpower
656 # $restorepower
Here is that last bit, where on the right is the current script from around 10-16 March script, and on the left is the modified version of the script that was available from around 15-17 February:
https://i.postimg.cc/Hk6g7R2W/14-spa...s-from-649.jpg
_(iv) The coding for the two new buttons starts at 1795, so from here we need to makes space down in the left coding in the following screenshot:
https://i.postimg.cc/g2SC0Rzn/Space-...ns-at-1795.jpg
( The changes of moving button positioning: Doesn’t concern me. I ignore that, since I already messed around a lot with where my buttons are )
That all now seems to be all needed to give me a modified version of the 15-17 February script,
win10debloatChris17Feb2022Bee.ps1 https://app.box.com/s/xpgcidd0ouhcc4xb8lxpm8xop51oto19
, which I will now use to partially help me to take my script to Temp6.ps1 from my Temp5.ps1
_.__________
_(i) Taking out $Label4 “Troubleshoot” = remove 8 lines , 293-300
Luckily, it seems that I have not yet used the spaces made by Debloating Chris’s script, so I am free to delete the lines as before.
This example shows a good illustration of the usefulness of keeping Chris’s original coding in green comments to the right: From this screenshot we immediately see the lines we need to remove.
https://i.postimg.cc/T338GQXz/Remove-Label4.jpg
Finally, removed Label4: https://i.postimg.cc/7Lby19s3/Removed-Label4.jpg
_(ii) Taking out $Label6 “Misc Fixes” = remove 8 lines , 426-433
Once again I have luckily not used yet the space created by removing Chris’s bloat,
https://i.postimg.cc/L89S52j0/Remove-Label6.jpg
https://i.postimg.cc/zf44CrRN/Remove-Label6.jpg
(The best way to do this , by the way, is to select the lines all from holding the left mouse button down in the margin and dragging to select all the lines. Then use delete key or back (-ve Tab < ) key : https://i.postimg.cc/RVQ9vNJH/Remove-Label6.jpg )
Finally removed Label6: https://i.postimg.cc/6QSxMZgD/Removed-Label6.jpg
_(iii) Adding a $oldpower button and $restorepower button requires adding in total 14 lines from 649. I am having to work a bit blind here, and also I have used some of the space here obtained by Debloating Chris’s script around line 649,
https://i.postimg.cc/XvrTBJqx/Used-a...e-from-649.jpg
, but carefully adding 14 lines seems to bring everything back into wach, https://i.postimg.cc/RVRrjy21/carefu...nes-at-649.jpg
and note coincidentally nicely separates the similar, but different sets of command lines
_ the single form adding to GUI stuff $Form.controls.AddRange(@(
and the
_ various panel adding to GUI sdtuff $Panelaskjdg.controls.AddRange(@(
A few comments to aid further orientation and we have this bit finished https://i.postimg.cc/cC7q1bCS/Adding...rientation.jpg
_(iv) The coding for the two new buttons starts at 1795
Fairly easy and straight forward:
Here the Before screenshot : https://i.postimg.cc/brhM59TF/Before-iv.jpg
Here the After screenshot : https://i.postimg.cc/FRc8GBjL/After-iv.jpg
Just to finally remind us what is going on here: That last screenshot is showing. On the left my final Temp6.ps1 ; The screenshot on the right is a file used to aid me get in wach with Chris’s latest ps1 file.
I can do a final quick check by substituting the right file for an actual current Chris ps1 script
https://i.postimg.cc/yxy5C3p6/After-...-march2022.jpg
Share ‘Temp6.ps1’ https://app.box.com/s/sn8dsqt237zffgkmjaqnvn7ewvqjdou8
( Link to first post on page #51
Page 51, Post #501
https://excelfox.com/forum/showthrea...ge51#post12776 )
This post: Page 51, Post #501
https://excelfox.com/forum/showthrea...ge51#post12776
https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page51#post12776
( link to last post on page #50 https://excelfox.com/forum/showthrea...ge50#post12775 )
#501 From about here is…. Clearing up some other minor issues, making up a few extra bits, along the way to and before doing my own complete rewrite from scratch
Examining Services
Following on, and in support of, this Forum Post: http://www.eileenslounge.com/viewtop...292266#p292266
In that Post we figured out how to get a text file 3 column list of the Service´s Name , DisplayName and StartType, using a single PowerShell script commandlet.
Get-Service|Select-Object name,displayname,starttype|Format-Table -AutoSize|Out-File -FilePath\ 'C:\Users\acer\Desktop\test.txt' -Width 1000
Here I want to automate that a bit, and get the result somewhere convenient, such as an excel spreadsheet.
I took a look at the text file produced, and based on that did a typical bit of coding to get all text column stuff into a convenient 3 “column” VBA array. It was all standard stuff.
https://excelfox.com/forum/showthrea...ll=1#post15357 https://excelfox.com/forum/showthrea...5356#post15356
Then I got some info for doing that PowerShell commandLet in VBA from Daniel Pineault here https://www.devhut.net/vba-run-powershell-command/
Here is a final macro
https://excelfox.com/forum/showthrea...ll=1#post16368
Example, on a Windows 10 Pro ( Version 20h2 19042.1466 )
Share ‘PowerShell.xls’ https://app.box.com/s/t65uuhic69g64yo4se2xuwopo9ezefa6
Share ‘test.txt’ https://app.box.com/s/lhln63eqcsn8d8zi0gd4yhrn09b3r79c
Share ‘Polak Services.JPG’ https://app.box.com/s/1ydaab5e5518flphg05i36xrp9n34r2q https://i.postimg.cc/65Rdrbvm/Polak-Services.jpg
https://i.postimg.cc/GHL8rQzF/Polak-Services.jpg
https://i.postimg.cc/65Rdrbvm/Polak-Services.jpg
Edit Some issues…
I messed up with a few things.
_ the display name could be long and go up to the startuptype in the text file, which messed up the manipulation of a line of data from the text file a bit. For now I fiddled that by adding some spaces before the words used for the startuptype. A better solution will probably wait until I fully understand the PowerShell code line
_ There seems to be some strange effects with something somewhere working too slow, too fast or not giving accurate information about if a text file is present. For now that is fiddled with some Waits , Dirs and a Kill. That will do for now, but that need to be looked at again when I understand better wots going on
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
https://www.youtube.com/watch?v=SIDLFRkUEIo&lc=UgzTF5vvB67Zbfs9qvx4AaABAg
https://www.youtube.com/watch?v=v_1iqtOnUMg&lc=UgxLtKj969oiIu7zNb94AaABAg
https://www.youtube.com/watch?v=f7xZivqLZxc&lc=Ugxq4JHRza_zx3sz0fx4AaABAg
https://www.youtube.com/watch?v=f7xZivqLZxc&lc=Ugxq4JHRza_zx3sz0fx4AaABAg
https://www.youtube.com/watch?v=f7xZivqLZxc&lc=UgzMCQUIQgrbec400jl4AaABAg
https://www.youtube.com/watch?v=LuAipOW8BNQ&lc=Ugz0Uy2bCSCTb1W-0_14AaABAg
https://www.youtube.com/watch?v=ITI1HaFeq_g&lc=Ugx12mI-a39T41NaZ8F4AaABAg.9iDQqIP56NV9iFD0AkeeJG
https://www.youtube.com/watch?v=vXyMScSbhk4&lc=Ugxa2VYHMWJWXA6QI294AaABAg. 9irLgSdeU3r9itU7zdnWHw
https://www.youtube.com/watch?v=tPRv-ATUBe4&lc=UgzFkoI0n_BxwnwVMcZ4AaABAg
https://www.youtube.com/watch?v=LuAipOW8BNQ&lc=Ugz0Uy2bCSCTb1W-0_14AaABAg.9htChVuaX9W9htG01cKBzX
https://www.youtube.com/watch?v=LuAipOW8BNQ&lc=Ugw6UrV69zpeKvLOeOV4AaABAg. 9ht16tzryC49htJ6TpIOXR
https://www.youtube.com/watch?v=LuAipOW8BNQ&lc=UgwMKwGZpDjv7vi7pCx4AaABAg
https://www.youtube.com/watch?v=LuAipOW8BNQ&lc=Ugw6UrV69zpeKvLOeOV4AaABAg. 9ht16tzryC49htOKs4jh3M
https://www.youtube.com/watch?v=LuAipOW8BNQ&lc=UgxVW-am20rQ5GFuJ9F4AaABAg
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
Post #502 URL link
https://excelfox.com/forum/showthrea...ge51#post12777
https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page51#post12777
#501bPower Shell Services list via Power Shell COM Object
I have been watching a series of videos from Ashish Raj, and here he does something similar with Services in PowerShell via COM Object Excel.Application
https://www.youtube.com/watch?v=xc8A7Z0JLB0&t=995s
His example is not exactly like my requirement, so I make some notes here of an attempt for a direct comparison.
To refresh what I did before, from Excel
I came up with a single PowerShell script code line to give me all the info I wanted in a text string, that is to say a text file. https://eileenslounge.com/viewtopic....292453#p292453
I did some initial work to check out the exact format of the final text file, which turned out to be a good idea, as there were some “invisible” characters that were best off got rid of.
https://excelfox.com/forum/showthrea...ll=1#post15357
https://excelfox.com/forum/showthrea...age3#post15357
, and here is a final Excel VBA solution that I ended up with
https://excelfox.com/forum/showthrea...l=1#post163689
https://excelfox.com/forum/showthrea...ge52#post16369
Summary of that final macro
There are a few fiddles to do with Waits and related coding in the macro. I don’t yet understand the problems there, so for now, no further comments on those. I concentrate on the main thing the macro is doing. Briefly: It:-
_ Does the PowerShell CmdLet to make a text file with all the info in it
_ Brings the text file into the Excel VBA coding
_ manipulates and pastes the data out in three columns
The final macro in more detail:-
The macro itself performs the PowerShell command
__ Get-Service|Select-Object name,displayname,starttype|Format-Table -AutoSize|Out-File -FilePath 'C:\Users\acer\Desktop\test.txt' -Width 1000
The macro then brings ( imports ) that text file into VBA as a single string stream, and manipulates the string in standard ways , to organise it into a 2 dimensional VBA array convenient to paste into a worksheet such that it comes out in 3 simple columns of info, as shown in the last post above
https://excelfox.com/forum/showthrea...ge51#post12776
_.________
Script similar to Ashish Raj’s
I am interested in the headings of name,displayname,starttype
Ashish had display name and status. He also collared a cell green or red to indicate running status or stopped status.
I will use my headings, but do a similar colouring.
This is the basic simple coding. ( Note the strange requirement to have an extra () in some places )
Share ‘AshishRajFeedbackCOMObjectExcel.ps1
’https://app.box.com/s/mnvyiln2xqs7elizhjassl1m74trmuve
Share ‘AshishRajFeedbackCOMObjectExcelAlanPreferredFor mat.ps1’
https://app.box.com/s/gjve7vriwgp4vu3q0l0vec0cvobccx9e
Code:Remove-Variable * -ErrorAction SilentlyContinue # This is very helpful when developing and debuging skript in the ISE, because the ISE has a habit of maintaining variables values between script executions, so this is needed, or else a removed variable may still be there - when fucking about with variables, this can get you in a very frustrating mess. In technical terms: By default variables are persistant. https://pscustomobject.github.io/powershell/howto/PowerShell-ISE-Clear-Variables/ https://eileenslounge.com/viewtopic.php?t=33011&sid=726de7ffbd0c03680b62280fd86753e0
# Path I have used for my text file output 'C:\Users\Admin\Desktop\test.txt' here full line Get-Service|Select-Object name,displayname,starttype|Format-Table -AutoSize|Out-File -FilePath 'C:\Users\Admin\Desktop\test.txt' -Width 2000
# and for Excel example file C:\Users\Admin\Desktop\PowerShellAshishRajFeedback.xls
try # Most of the main coding is in a try section ==============================================================================
{[object]$excel = New-Object -ComObject Excel.Application # https://www.youtube.com/watch?v=xc8A7Z0JLB0&t=995s
$excel.Visible = $true
[string]$excelPath = "C:\Users\Admin\Desktop\PowerShellAshishRajFeedback.xls"
$excelWB = $excel.workbooks.Open($excelPath)
# Worksheets info
$excelWS=$excelWB.WorkSheets.item("AshishRajCOM")
$excelWS.Activate() # It seems that in PowerShell script an extra () is needed
$excelWS.Cells.Item(1, 1).Value = "name" ; $excelWS.Cells.Item(1, 2).Value = "displayname" ; $excelWS.Cells.Item(1, 3).Value = "starttype"
# write in service
[int]$rowWS = 2
ForEach($Service in Get-Service) { $excelWS.Cells.Item($rowWS, 1).Value = $Service.Name.ToString() ; $excelWS.Cells.Item($rowWS, 2).Value = $Service.DisplayName.ToString() ; $excelWS.Cells.Item($rowWS, 3).Value = $Service.StartType.ToString()
If($Service.Status -eq "Running") { $excelWS.Cells.Item($rowWS, 1).Range(”A1:C1").Font.ColorIndex = 10 }
elseif($Service.Status -eq "Stopped") { $excelWS.Cells.Item($rowWS, 1).Range("A1:C1").Font.ColorIndex = 3 }
$rowWS++ }
$excelWS.Cells.Columns("A:C").EntireColumn.AutoFit() # Tidy up column widths
# $excelWB.SaveAs($excelPath)
$excelWB.Save() # It seems that in PowerShell script an extra () is needed
$excel.Quit() } # =============================================================================================================
catch { Write-Host "some error occurred" }
finally { $excel.Quit() } # this section will be done if an error occurs
#502aPower Shell 7
Hans and Joe have put me on to this open source non Windows thing. (I think its still from Microsoft, and also its somehow involved with GitHub… https://eileenslounge.com/viewtopic....292238#p292238 https://eileenslounge.com/viewtopic....292008#p292008 https://eileenslounge.com/viewtopic....292018#p292018
There are a lot of useful links they gave which I will need to look through thoroughly when I have the time
Getting it, downloading, up and running etc. Intro.
Its fairly new, (at least compared with my most old stuff!) . Maybe for that reason the internet stuff on it is spares and some of seems a bit contradicting, in particular how and where it is downloaded. So I started playing around…
Download
There seems to be a lot of stuff, sometime contradictory about this.
For no particular reason I started doing it from a new button on me current in development Debloat [color=lightgrey ]/ Tool / Utility [/color]GUI thing. That is taking things perhaps a few step further than I might normally, but I am ( was) not sure where it goes, and I was a bit worried of only having one chance, that is to say not being able to get rid of it cleanly to start again, so I tried to hit a compromise a bit nearer to my current end goal, ince I want it possibly as an install option on the Debloat / Tool / Utility thing.
I put on a button, taking the syntax from a combination of internet searching and what was on some existing buttons
I clicked and it seemed that the first attempt hanged, ( that was evening 9 Feb )Code:$PS.Add_Click({
Write-Host "Installing PowerShell 7"
$ResultText.text = "`r`n" +"`r`n" + "Installing PowerShell 7... Please Wait"
winget install --id Microsoft.PowerShell --source winget| Out-Host
if($?) { Write-Host "Installed PowerShell 7" }
$ResultText.text = "`r`n" + "Finished Installing PowerShell 7" + "`r`n" + "`r`n" + "Ready for Next Task"
})
https://i.postimg.cc/5ys1x1tj/Power-...instal-1-8.jpg
https://i.postimg.cc/T1dfMhfZ/Power-Shell-instal-2.jpg
https://i.postimg.cc/FRgNB05y/Power-...nstal-hung.jpg
I had to restart the computer, ( or stop the ISE through task-Manager ) to clear the hanged situation in the ISE and the GUI
Next Day:
On the second attempt at clicking the button ( morning 10 Feb ) it seemed to get a lot further
https://i.postimg.cc/J4SvjtSM/Power-Shell-instal-5.jpg
https://i.postimg.cc/6QXP1g9P/Power-Shell-instal-6.jpg
https://i.postimg.cc/q7xFfwqv/Power-Shell-instal-7.jpg
https://i.postimg.cc/6pRSctNR/Power-Shell-instal-9.jpg
https://i.postimg.cc/yYD2J0QL/Power-...y-finished.jpg
When I finally found where some of the stuff was, it seemed to suggest it was put there on the 9 Feb.
https://i.postimg.cc/9FjRNY6k/seemed...-yesterday.jpg
( Note also that WindowsPowerShell is also there, (and that is possibly related to what I find at a place that some internet research suggested I should find not the existing 5.1 and the new 7.2. In fact I only see after the install the existing 5.1 https://i.postimg.cc/52rfDxHt/Window...-2-install.jpg Note also that nothing related to 5.1 ( WindowsPowerShell) seems to be in the normal program list )
As I found where it was, and it appeared as a normal installed program,
https://i.postimg.cc/TYjN5Qjq/de-install-1-2.jpg
https://i.postimg.cc/kXPh5LSg/de-install-3.jpg
, I de installed it just for fun, so as to be able to install it again
Second attempt at instal:
I hit the button again and it seemed to install
https://i.postimg.cc/k5q4KLMc/Install-1.jpg
https://i.postimg.cc/9QG04c20/Install-2.jpg
https://i.postimg.cc/13x45fLb/Install-3.jpg
https://i.postimg.cc/sDGvrp0p/Install-4.jpg
https://i.postimg.cc/JnhzdJkH/Install-5.jpg
https://i.postimg.cc/8k0j9ywp/Install-6.jpg
https://i.postimg.cc/1zr8ds72/Install-7.jpg
Once again it seemed to hang, , but this time I looked at this stage at the place it was in, and it would appear to be there. https://i.postimg.cc/Fz8zSR1d/Seemed...-its-there.jpg
So I made a copy of the 7 Folder, https://i.postimg.cc/cH1vy2VH/Kopie-7.jpg , then used task manager to stop the hanged stuff, https://i.postimg.cc/nh7jvv4H/Right-...sk-Manager.jpg , https://i.postimg.cc/j58Lsvbh/Task-M...SE-process.jpg , then re started the script and re clicked the button.
On this second, second attempt the download went as before, but did not hang.
So this was the same as by the first second attempt.
A quick look suggests that nothing has changed, https://i.postimg.cc/L6GgYyZC/Kopie-...nd-attempt.jpg , and so an initial conclusion is that the first attempts, that is to say the first clicks which appeared to end in a hang, did actually in fact produce a successful download
#502bChecking a few things now I have PowerShell 7
#502b issue with service "dmwappushservice"
http://www.eileenslounge.com/viewtop...292235#p292235
http://www.eileenslounge.com/viewtop...292005#p292005
https://excelfox.com/forum/showthrea...ge50#post12768
If we take a look now, using PowerShell 7.2 to do this, on a non tweaked machine ( Win 10 20H2 (Build 19042.1466) ) ,
Get-Service|Select-Object name,displayname, starttype |Format-Table -AutoSize|Out-File -FilePath 'C:\Users\acer\Desktop\teststarttype.txt' -Width 1000
Get-Service|Select-Object name,displayname,startuptype|Format-Table -AutoSize|Out-File -FilePath 'C:\Users\acer\Desktop\teststartuptype.txt' -Width 1000
, then we can see that, for example by "dmwappushservice" , then now we can also get the option of Automatic (Delayed Start)
https://i.postimg.cc/VLHKgShb/Got-Au...ayed-Start.jpg https://i.postimg.cc/HkqBGqdY/Got-Au...ayed-Start.jpg
https://i.postimg.cc/qzycM74k/Got-Au...ayed-Start.jpghttps://i.postimg.cc/TKcrgHKF/Got-Au...ayed-Start.jpg
Share ‘teststarttype.txt’ https://app.box.com/s/u4xxiefbgh2b13e3vn10ho2l497lbzn5
Share ‘teststartuptype.txt’ https://app.box.com/s/q7lxmr1ffz9slf24cpgk7c1db3mourd4
Set-Service "dmwappushservice"
On the same computer I confirmed that I can set the option of Automatic (Delayed Start) provided I use something like this in PS7
Set-Service "dmwappushservice" –StartupType AutomaticDelayedStart
https://i.postimg.cc/BQDjYkYc/Set-Se...rter-Start.jpg
https://i.postimg.cc/BnBXsDGj/Set-Se...ice-Manual.jpg
https://i.postimg.cc/WhNptWPh/Set-Se...rter-Start.jpghttps://i.postimg.cc/FY19VYzv/Set-Se...ice-Manual.jpg
But note that I will need to open as Administrator , https://i.postimg.cc/vm8DmBQ3/Right-Click-PS7-Admin.jpg
, or else it will error, https://i.postimg.cc/13QfLBbx/Oops-P...t-as-Admin.jpg
https://i.postimg.cc/NKVQJQ2H/Right-Click-PS7-Admin.jpghttps://i.postimg.cc/Lnx9PtHv/Oops-P...t-as-Admin.jpg
slkhflskhfslkhf
This is post #505
https://excelfox.com/forum/showthrea...ge51#post12780
https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page51#post12780
At last old scripts!! !
This is a year or so out of place, here, in my own personal notes. But no one anywhere answered my pleas for help in getting copies of the older scripts, which I had wanted to get so as to…
_ aid me getting back up to date ,
, and to,
_ aid me in my learning of this Debloat stuff as well as the related learning of PowerShell script
Specifically, I want to get scripts, where each script relates to the script at the time of, and relevant to, each of Chris’s Debloat related YouTube Videos
I came across a related issue by coincidence here, https://github.com/ChrisTitusTech/wi...ipt/issues/229
, where then brandonkal showed me how to do it https://github.com/ChrisTitusTech/wi...ent-1042610457
https://github.com/ChrisTitusTech/wi...ent-1042788256
( Edit. I solved this issue and quite a few others in a lot of posts at GitHub around February March, but my account was deleted and all posts removed. No big deal, I was never so keen on the place, it seems to slow down and mess up projects, at least any I helped in. Maybe that did not go down too well. Possibly the real reason of GitHub is to mess some peoples projects up? )
Solution to get old scripts
Here we go, just to remind me for future reference:
This solution seems very tolerant of even older Browsers and operating systems and there is no need to be logged in or have an account at GitHub.
It’s not at all obvious, as with most things at GitHub, but once you do know, it’s a piece of piss, no problem at all and quick:
Working example, for example Chris’s win10debloat stuff scripts..
_1) Go to Chris’s GitHub Windows 10 Debloat page, https://github.com/ChrisTitusTech/win10script . By default you should be at the Code page, but to be sure hit the code button top left https://i.postimg.cc/fbRJrHN8/Code-B...10-Git-Hub.jpg
https://i.postimg.cc/P5hLmXFs/Code-B...10-Git-Hub.jpg
_ 2) Hit the History Clock icon https://i.postimg.cc/HxjdQRgC/Histor...10-Git-Hub.jpg
https://i.postimg.cc/qRY0QwJ6/Histor...10-Git-Hub.jpg
What you should now see is a page with a track / progress like vertical line along the left margin with junction points on it. Going down is like going back in the History https://i.postimg.cc/NfR999Dk/Histor...at-Git-Hub.jpg
_2b) Furthermore, towards the bottom is an older button,
https://i.postimg.cc/Y2Gm7ymV/Older-...ds-in-time.jpg
, which takes you to the next page allowing you to go even further back in time.
As far as I can tell, you can go right back to the beginning.
_3) Where what when to look for
Under the various dated junction points are things listed as “commits”. I don’t fully understand yet all the workings and what things that are being referred to, but I think I am only interested in changes to the main script, which are those referred to by something like Update win10debloat.ps1 https://i.postimg.cc/s1CzC2ZV/Click-...ebloat-ps1.jpg
A clue to what was done at that time to the script may be obtained by other things around the same date, and/ or you may get a hint from clicking on that word, Update win10debloat.ps1 , https://i.postimg.cc/FzKjjjr6/Click-...ebloat-ps1.jpg , which then will give some indication in a red / green before after type pictorial view
https://i.postimg.cc/13H8BkLg/Click-...-type-view.jpg
https://i.postimg.cc/SnnQNvQq/Click-...-type-view.jpg
As example, that last screen shot is looking around the February 15 2022 time. Clearly there is something going on with “Virtualisation” things
Relating a script to a Chris YouTube Debloat Video
Chris does not typically give a direct reference to the script relevant to his Debloat related Videos. But it’s a fairly good guess that an Update around the time of a video, possibly shortly before, will be the one.
Taking that last example, the from Feb 15, 2022, : If we look at Chris’s videos from about that time we find a couple of videos related to the theme of “Virtualisation” things:
9.31a Live - Improving Virtualization in Windows-fYhBE4B77S8_18 02 2022
https://www.youtube.com/watch?v=fYhBE4B77S8
https://drive.google.com/file/d/19SH...?usp=drive_web
9.31b How to Setup Hyper V on Windows-FCIA4YQHx9U_19 02 2022
https://www.youtube.com/watch?v=FCIA4YQHx9U
https://drive.google.com/file/d/1Gfo...?usp=drive_web
We can conclude fairly safely here that this script change mainly involved adding a button to enable some in built Windows “Virtual-V” feature. ( The script changes will be the changes I talked about in the second half of this post of mine,
https://excelfox.com/forum/showthrea...ge50#post12774
, which took my script, (which is approximately following Chris’s script), from my version Temp4.ps1 to Temp5.ps1 )
It is not always obvious that a video gives some indication of, or is related to a change.
Sometimes the change may not be related specifically to some new addition referred to in a video.
We might be able to relate it to something else, for examples…
_ We might sometimes be able to refer it to some issue if you take a look down the list ( https://github.com/ChrisTitusTech/win10script/issues https://i.postimg.cc/kGhWwBDg/Chris-...Hub-Issues.jpg )
_ Chris may refer to it either in passing or as it may be slightly related to a video. For example, the things that took my script from my version Temp5.ps1 to Temp6.ps1 ( https://excelfox.com/forum/showthrea...ge50#post12775 ) where some power related things which he mentioned briefly in these videos:
9.32 Live - Optimizing Windows for Gaming-z3DNobuvkL8_11 03 2022
https://www.youtube.com/watch?v=z3DNobuvkL8
https://drive.google.com/file/d/1WcT...?usp=drive_web
Optimize Windows for Gaming-KjHfCDPfLdI_12 03 2022
https://www.youtube.com/watch?v=KjHfCDPfLdI
https://drive.google.com/file/d/1O7h...?usp=drive_web
( See also some of my notes in this excelfox Thread post https://excelfox.com/forum/showthrea...ge43#post12702 )
Get the actual script code
So at this point we have identified the win10debloat.ps1 that we are interested in. Now to get the actual code….
Its generally regarded as best taking what is referred to as the Raw code. I think this is intended to be a very clean text, rather than one that my have some things like “invisible” characters or something to do with formatting that might get accidentally copied in any simple copying attempt
Get the Raw
_(i) If we are looking at the Red green before after…
First look for a View File option, https://i.postimg.cc/3JqkwF7b/View-F...fore-after.jpg . Click that, and you see a color formatted code. Look for the Raw option and click that, https://i.postimg.cc/15XgPjxq/Raw-option.jpg
This should get the raw code view, https://i.postimg.cc/RhsNKcth/Raw-code.jpg
_(ii) If we are looking at the History page.
Look for a _ < >_ button at the right, https://i.postimg.cc/9QqrwwQX/Pointy...ode-button.jpg and click that.
This should take us to what looks like the main code page where we started with.
https://i.postimg.cc/gjWrQQn6/Achaiv...previously.jpg
But actually it is something close to an archived copy of the main page at the previous chosen commit date. That page can be used in the same way you would use the current main page.
So for example,
_ click on the win10debloat.ps1 , https://i.postimg.cc/4d1KNCNz/Click-...ebloat-ps1.jpg
_ we can now click on the Raw option, https://i.postimg.cc/VsDSxchw/Raw-option.jpg , and once again we see the Raw code, https://i.postimg.cc/W4LtGpdG/Raw-code.jpg
Copy Raw _ Ctrl+a , Ctrl+c
The simplest way to copy the raw code is to click anywhere in it , then use the key combination of Ctrl+a , which should select/ highlight the entire code, followed by Ctrl+c
That should give you a clean text copy in the clipboard.
So that’s it. Do now with that code what you want, such as
_ paste it in a text editor such as Notepad or Notepad++ if , as me, you just want to look at it,
or
_ probably the most useful, paste it in an as Administrator launched ISE development window, and then you can do all - look at it, edit it, and run it conveniently as and when you choose
_._____________
The quick link
One last thing, just for completeness, but which I am not so keen on using, persinally.
Brandonkal also showed me how to get the quick link to run the script. But very important to note here is what brandonkal went on to say about …….. check the code for unversioned dependency links….. - He is warning of bad programming practice. For example, the code downloads "raw.githubusercontent.com/ChrisTitusTech/win10script/master/ooshutup10.cfg" which always points to the latest version. If you wish to have that file match what it was in an earlier version, you will have to update that reference in a fork.
The short link, or “one liner”, I am talking about is that often given by Chris at his site and in videos ,
iex ((New-Object System.Net.WebClient).DownloadString('https://git.io/JJ8R4'))
, which he often describes as something like, the “one commend to run ‘em all”. That is basically a single code line to paste in PowerShell that somehow goes off via the internet and gets the script and does anything else necessary to get the script up an running for you somehow and run it live somehow on your computer. I am less keen on using that as it has the disadvantage that you don’t actually get the script to look at and edit. But it can be a convenient way to run the coding.
Chris always gives the line for the current version, ( which can upset some people, example, https://github.com/ChrisTitusTech/wi...ent-1043477046 ) , but we can actually get the same one liner for the older script that we are interested in.
Example:
Take once again the example of, February 15, 2022 , and look at some numbers and URLs that have been seen in the screenshots
_ Example: The Raw URL: https://raw.githubusercontent.com/ChrisTitusTech/win10script/c349966ed313d5d7979aeb58e2c3a7ae3f494c6f/win10debloat.ps1 https://i.postimg.cc/DzLJHJ9p/Raw-URL.jpg
_ Example: A commit number that may have shown up in a few places, fc37c7d
We may replace the download string in Chris’s one liner, with a either of these based on those numbers
( I am not too sure yet of the validity always of the last one, so perhaps best to use the first).Code:iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ChrisTitusTech/win10script/c349966ed313d5d7979aeb58e2c3a7ae3f494c6f/win10debloat.ps1'))
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ChrisTitusTech/win10script/fc37c7d/win10debloat.ps1'))
Here just again for final clarity, first the typical one liner used currently to get the new GUI up and running,
and after the second one is for the script from 15 Feb 2022_.______Code:iex ((New-Object System.Net.WebClient).DownloadString('https://git.io/JJ8R4'))
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ChrisTitusTech/win10script/c349966ed313d5d7979aeb58e2c3a7ae3f494c6f/win10debloat.ps1'))
So that’s it all. :)
In the next post I apply this knowledge to get specific Chris scripts, concentrating mostly on those most asked for, which usually are those talked about on his normal size videos specifically on the script and script updates.
I may also take the opportunity for some extra notes a second time around, as well as look at some script versions that introduced things ( problems more often, lol, ) but which were not particularly discussed in any video.
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.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.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
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
GUI VersionCode: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'))
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.jpgCode: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'))
https://i.postimg.cc/4YhRjjfH/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
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.jpgCode: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'))
https://i.postimg.cc/06NBdbVv/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 )
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 ISECode: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'))
But the one line command did run from the one line command in a normal PowerShell window, ( opened as Administrator ) .
______________________________
Continued in next post
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
It’s a very popular video so Chris probably leaves it up. But he does not seem to keep the notes up to date.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'))
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.
a few extra notes a second time around,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')
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
( Note on running from the ISE, the code is printed out in the PowerShell window of the ISE )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'))
______________________________
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
The GUI is almost too big on 1366x768 https://i.postimg.cc/Y0jR251C/Chris-...I-1366x768.jpgCode: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'))
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
https://i.postimg.cc/Y0jR251C/Chris-...I-1366x768.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
https://i.postimg.cc/pLM0vGcD/Chris-...at-fuck-up.jpg
a few extra notes a second time around,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'))
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
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 https://i.postimg.cc/GTwGqS7W/Chris-...I-1366x768.jpghttps://i.postimg.cc/8jCrRfmB/Chris-...ows-Search.jpg
Windows Search button under System Tweaks
All the windows search, web search through .. to disable indexer.
In the next video, Cortana is mentioned in connection with searching, so just for reference, this is behind the : Cortana button under System TweaksCode:$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)
})
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 Utilityhttps://i.postimg.cc/21cQqLXM/Chris-...1-1366x768.jpg
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) buttonhttps://i.postimg.cc/BXByP6C0/Chris-...ith-Search.jpg
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"
})
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 previousCode:$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"
})
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
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 thishttps://i.postimg.cc/PLvHvRQZ/Broken...ks-12-July.jpg
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 ps1And here is the $WindowsSearch.Add_Click(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'))
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
https://i.postimg.cc/K8zWNtpH/Chris-...8-July2021.jpg
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 )
https://i.postimg.cc/DJ5LTx10/The-Three-GUIs.jpg
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
slkhflskhfslkhf
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: https://i.postimg.cc/mtTPPYqM/Temp6-March2022.jpg
_......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
https://i.postimg.cc/5210fm8N/Temp7-March2022.jpgjdklad
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
ISE v Microsoft Office VBA VB EditorI 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
https://i.postimg.cc/mzZczpQ1/ISE-v-VB-Editor.jpg
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 )
https://i.postimg.cc/dZPvh72L/Temp8-2-Aprill-2022.jpghttps://i.postimg.cc/XGy4NKyR/Temp8-2-Aprill-2022.jpg
Temp8_02Apr2022.ps1 https://app.box.com/s/zz99n0yry1ssjs5wy3g0hj1qtwtpcnm1
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 ).
(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 ChrisCode:$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
This next one is completely mine. It puts a small Green button as for FAQs Main Tweaks
I had to then do some more stepsCode:$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
_ 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
Here the two buttons as seen on the GUICode:$urlMainTweeaksFAQ.Add_Click({
Start-Process "https://www.excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page60#post12965"
})
https://i.postimg.cc/7f46G5QR/First-...rl-buttons.jpg
Code in Add_Click to function alternativeIn 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
A function of this sort may or may not do something itself other than returning something as a function of what it is given.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"
})
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.
slkhflskhfslkhf
Extending download tool options to include chocolatey
Currently Chris’s tool on first running checks for if the Microsoft App winget is installed. If not, it is installed. This app is somehow used to download other things form a “Microsoft store”.
Previously Chris had a button to choose to install an alternative downloading app tool, chocolatey, which you can then use to download other things if you choose. ( https://excelfox.com/forum/showthrea...ge51#post12782
Script: 04.12.2020 The Best Windows 10 Toolbox
Share ‘Chris2December2020FirstGUI.ps1’ https://app.box.com/s/2btpz9fefsc57eqagy5iz9janq7622zg )
I was thinking of adding a multiple downloading App option, allowing you to use winget or chocolatey. (Those download tools may themselves first needs to be downloaded )
There seems to be some mixed opinions on what is best, Examples : https://www.youtube.com/watch?v=rPfz...RP5PL5l4AaABAg
https://github.com/ChrisTitusTech/wi...ipt/issues/229
Originally Chris was keen on, and used , chocolatey. He seems as keen on winget now. But he often swings a bit from one thing to the other. Sometimes it seems justifiable, sometimes it just seems like he is like that.
I am less keen generally on downloading stuff on the tool, especially as whether it works or not seems to be a bit unpredictable and changes, especially for winget.
But I might keep the option for now. Having the two options will increase the chance of it working.
What I thought would be cool is that if the background color of the buttons for you winget or chocolatey would be different, and on clicking them, the download background color of the buttons for the downloads changed correspondingly, and at the same time some flag was set to indicate which of the two download tools should be used
( One small complication for now: The winget install does not seem to work in a button.
https://eileenslounge.com/viewtopic.php?f=12&t=37771
https://excelfox.com/forum/showthrea...ge51#post16363
I will ignore that for now, and leave in Chris’s script at the start that installs it if necessary)
First I have at this stage the winget install button. It’s after most of the other buttons are made, so I can apply the background colour change to the download buttons. I will choose navy for winget and brown for chocolatey
Examining the existing button I made for winget install, https://excelfox.com/forum/showthrea...6363#post16363 , we see we can make a bit of room by shifting everything down a bit, https://i.postimg.cc/HxVqtwhM/Shift-...make-space.jpg
A simple ForEach on an array of the relevant download button object variables gives us a convenient way to colour the background of the buttons
Later in the buttons, we can use a check on that color to determine what of the download apps is usedCode:$GetWinGet.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#000080") # this could go in the array as well
$Dnlds = @($PS, $PS7_2, $winterminal, $notepad, $vscode, $vscodium, $firefox, $gchrome, $mpc)
ForEach ($Dnld in $Dnlds){$Dnld.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#000080" )} #000080 navy .BackColor.Name is ff000080
_._________
Chocalety button
I don’t have this yet on my current script version, but I have a space that I anticipated using, https://i.postimg.cc/dkRHLVt2/Space-...tey-button.jpg, and so adding the button is easy, just as I added all the rest:
Three main things to do, ( It would be only two if I was not using a panel)
This first bit uses my buttton making function
This second bit adds the button to a panelCode:$GetWinGet = Create-Button -Text "winget" -FntSz 9 -Width 117 -Height 21 -ClmX 3 -RwY 1 -FClr "#FFFFFF" -BClr "#417394" ; $Getchoco = Create-Button -Text "chocolatey" -FntSz 9 -Width 117 -Height 21 -ClmX 121 -RwY 1 -FClr "#FFFFFF" -BClr "#417394"
( I don’t need to do the third bit, add the panel to the form, as the panel is that already added and having the winget button )Code:$Panel10.controls.AddRange(@($GetWinGet, $Getchoco))
The same technique for the background colouring can be applied at the start of, as I add, a new .Add_Click bit for chocolatey.
https://i.postimg.cc/zGPtFv4H/Added-...-Add-Click.jpg
It seems to work OK, ( I chose Olive as a common standard html color, close to brown color )
https://i.postimg.cc/KYCTZkHb/Olive-...chocolatey.jpg https://i.postimg.cc/1gcXBtS7/Olive-...chocolatey.jpg
Before moving on with the download issues, I want to review some downloading PowerShell. I may add a lot more to that later, so I will do it all in its own post, the next one. I may or may not come back to this post.
This is post https://excelfox.com/forum/showthrea...e52#post127912
https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page52#post127912
Collecting a few downloading PowerShell scripts
I can get some of this info from the archived stuff I recently learnt how to get at, ( https://excelfox.com/forum/showthrea...ge51#post12780
https://excelfox.com/forum/showthrea...ge41#post12675 ).
As well as the basic download app, (chocalatrey or winget, I also look at some other stuff, for example, Richard’s original .Net 3.5, and Brave browser as that was done outside the download app initially
Richard Newton’s original .Net 3.5, from around March 6 - October 2019, when Chris had not noticed yet that Richard already had a GUI!Share ‘Richard6March2019GUI.ps1’ https://app.box.com/s/9jb475u0zfxub44hw0sd7212kft6moi7Code:$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!"
} )
In April 2020 it had not changed, nor in April 2022
_.________
ChrisFirstScript27July2020.ps1 ( Not GUI )
Share ‘ChrisFirstScript27July2020.ps1’ https://app.box.com/s/atcfp24bua063oi2mui4cf9hs5yada39Code:Function InstallTitusProgs {
Write-Output "Installing Chocolatey"
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install chocolatey-core.extension -y
Write-Output "Running O&O Shutup with Recommended Settings"
Import-Module BitsTransfer
Start-BitsTransfer -Source "https://raw.githubusercontent.com/ChrisTitusTech/win10script/master/ooshutup10.cfg" -Destination ooshutup10.cfg
Start-BitsTransfer -Source "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" -Destination OOSU10.exe
./OOSU10.exe ooshutup10.cfg /quiet
}
_.__________________
ChrisSecond( He says Version1)Script29Oct2020.ps1
Function InstallTitusProgs is same as last script, for example to get chocolatey download app
Brave added fist time
Share ‘ChrisSecond(Version1)Script29Oct2020.ps1’ https://app.box.com/s/s7zwspwft02klem81c747wpoycarkjacCode:Function InstallBrave {
do
{
Clear-Host
Write-Host "================ Do You Want to Install Brave Browser? ================"
Write-Host "Y: Press 'Y' to do this."
Write-Host "2: Press 'N' to skip this."
Write-Host "Q: Press 'Q' to stop the entire script."
$selection = Read-Host "Please make a selection"
switch ($selection)
{
'y' {
Invoke-WebRequest -Uri "https://laptop-updates.brave.com/download/CHR253" -OutFile $env:USERPROFILE\Downloads\brave.exe
~/Downloads/brave.exe
}
'n' { Break }
'q' { Exit }
}
}
until ($selection -match "y" -or $selection -match "n" -or $selection -match "q")
}
_._________________
Chris2December2020FirstGUI
Code:$installchoco.Add_Click({
Write-Host "Installing Chocolatey"
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install chocolatey-core.extension -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$brave.Add_Click({
Invoke-WebRequest -Uri "https://laptop-updates.brave.com/download/CHR253" -OutFile $env:USERPROFILE\Downloads\brave.exe
~/Downloads/brave.exe
})
Share ‘Chris2December2020FirstGUI.ps1’ https://app.box.com/s/2btpz9fefsc57eqagy5iz9janq7622zg
_._______________
Chris7JulySecondGUIGreyGUI2021.ps1
First use of winget
Share ‘Chris7July2021.ps1’ https://app.box.com/s/2btpz9fefsc57eqagy5iz9janq7622zgCode:Try{
# Check if winget is already installed
$er = (invoke-expression "winget -v") 2>&1
if ($lastexitcode) {throw $er}
Write-Host "winget is already installed."
}
Catch{
# winget is not installed. Install it from the Github release
Write-Host "winget is not found, installing it right now."
$download = "https://github.com/microsoft/winget-cli/releases/download/v1.0.11692/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
$output = $PSScriptRoot + "\winget-latest.appxbundle"
Write-Host "Dowloading latest release"
Invoke-WebRequest -Uri $download -OutFile $output
Write-Host "Installing the package"
Add-AppxPackage -Path $output
}
Finally {
# Start installing the packages with winget
#Get-Content .\winget.txt | ForEach-Object {
# iex ("winget install -e " + $_)
#}
}
$brave.Add_Click({
Write-Host "Installing Brave Browser"
winget install BraveSoftware.BraveBrowser | Out-Host
if($?) { Write-Host "Installed Brave Browser" }
})
_.______________________________________
From here some work was done at GitHub Pulls on how winget was got
Dynamically get the download Uri for the latest stable release of winget 3 Aug 2021
DynamicGetUriForLatestStablerelOfwinget3Aug2021.ps 1 https://app.box.com/s/7rmx2zsasymftrikjojjs3p3g1g8lng6Code:Try{
# Check if winget is already installed
$er = (invoke-expression "winget -v") 2>&1
if ($lastexitcode) {throw $er}
Write-Host "winget is already installed."
}
Catch{
# winget is not installed. Install it from the Github release
Write-Host "winget is not found, installing it right now."
$asset = Invoke-RestMethod -Method Get -Uri 'https://api.github.com/repos/microsoft/winget-cli/releases/latest' | ForEach-Object assets | Where-Object name -like "*.msixbundle"
$output = $PSScriptRoot + "\winget-latest.appxbundle"
Write-Host "Downloading latest winget release"
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $output
Write-Host "Installing the winget package"
Add-AppxPackage -Path $output
Write-Host "Cleanup winget install package"
if (Test-Path -Path $output) {
Remove-Item $output -Force -ErrorAction SilentlyContinue
}
}
Finally {
# Start installing the packages with winget
#Get-Content .\winget.txt | ForEach-Object {
# iex ("winget install -e " + $_)
#}
}
_._______________________________
MicrosoftStoreWinget28Aug2021
MicrosoftStoreWinget28Aug2021.ps1 https://app.box.com/s/0hde8k4ocsvx57l6ozldd8nxss6l8lmjCode:Write-Host "Checking winget..."
Try{
# Check if winget is already installed
$er = (invoke-expression "winget -v") 2>&1
if ($lastexitcode) {throw $er}
Write-Host "winget is already installed."
}
Catch{
# winget is not installed. Install it from the Microsoft Store
Write-Host "winget is not found, installing it right now."
Start-Process "ms-appinstaller:?source=https://aka.ms/getwinget"
$nid = (Get-Process AppInstaller).id
Wait-Process -Id $nid
}
Finally {
# Start installing the packages with winget
#Get-Content .\winget.txt | ForEach-Object {
# iex ("winget install -e " + $_)
#}
}
_.________________________________________________ _____
SlimedWinget31Aug2021
SlimedWinget31Aug2021.ps1 https://app.box.com/s/llsza3dbwdgnvn8no0tl5pr4ink8e2yaCode:Write-Host "Checking winget..."
# Check if winget is installed
if (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe){
'Winget Already Installed'
}
else{
# Installing winget from the Microsoft Store
Write-Host "Winget not found, installing it now."
Start-Process "ms-appinstaller:?source=https://aka.ms/getwinget"
$nid = (Get-Process AppInstaller).Id
Wait-Process -Id $nid
Write-Host Winget Installed
}
slkhflskhfslkhf
This is post #519 https://excelfox.com/forum/showthrea...ge52#post12794
https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page52#post12794
Process Manager
This is a bit late in the winter for me to be still posting stuff here, and perhaps a bit off-topic, ( actually as it went on, maybe not so off-topic.. )
By chance I stumbled on a short YouTube play list: https://www.youtube.com/watch?v=Qh_s...qYMCmHkbEIiver
Initially I saw it as a nice well explained PowerShell GUI series to help my recently acquired PowerShell GUI knowledge. But then as I got more into understanding the second video, ( Process Manager - https://www.youtube.com/watch?v=GQSQ...EIiver&index=2 ) , I suddenly realised that there might be some application to some of my Debloat script ideas.
I wont take this much further until much later in the year, but these notes are just intended to remind me of what I learnt to the workings of the script, in particular the Process Manager. I am basically working through, and doing a walkthrough explanation of, the script given : https://pastebin.com/b5VMrmz7
_.___________
Some basic script coding of relevance/ differences to VBA
Basic concepts: . and | ( “dot” and “pipe/Piping” )
I think if you know VBA then you can fairly easily pick up PowerShell.
There is a similar object orientated hierarchical idea which you get through a . , and that is pretty well the same as in VBA.
But then there is a similar concept in parallel, a piping, | , which works a bit as its name suggests in that you filter or select/modify things as you go along the pipe sections: Think of it as pipes of different dimensions and / or pipes that filter or use or present the stuff flowing in different ways. The | separates the different sections. Some of the things going on in these stream like piping concepts sections are similar to SQL stuff
For Each Looping
In VBA this idea can be shown approximately in this pseudo coding:
__For Each Thing In theCollectionOfThings
___' This section is automatically looped for as many times as we have things, and each thing is put in the variable, Thing. We sometimes refer to Thing as the steering variable, and would need to be of type Variable or Object
___ Thing.doingstuff
___ Let SomethingElse = Thing.Something
__Next Thing
In PowerShell script we can approximately say that we have two ways to do this,
_ the first is like that in VBA , but just the syntax looks slightly different.
_ the second way is a bit more weird and needs us to introduce something completely new, which is usually used in conjunction with the looping: This - $_. ( That - $_ could also be used in the first way, but so far I have not seen it used there)
PowerShell Way1:-
Same idea , different syntax
__ For Each ( $Thing In $theCollectionOfThings ) {
___# This section works similarly to the VBA case ( In PowerShell script all variable names tart with a $ )
___ $Thing.doingstuff
___ $SomethingElse = $Thing.Something
__}
PowerShellWay2 ( Way2a) and way2b) ):-
This usually comes about during the piping of stuff, and it is less obvious that a loop happens. But is does. The difficulty in grasping this possibly comes about because the piping idea suggest that lots of things simultaneously are flowing. That can’t really happen., and they are really flowing one after the other, all be it so fast that to us they all are flowing in parallel simultaneously. I think perhaps the development and background low level stuff works so efficiency that it can be considered as if they all are flowing in parallel simultaneously. But as they are in fact looping, we can take advantage of this and “sneak in” a doing something loop. I suppose another way of thinking about this is that we have the ability to customise the filtering/selecting/modifying things going on in the Pipe sections.
This way 2 is somewhat tricky to understand because, as I write this I have seen two ways to do it, so I am looking at Way2a) and way 2b). But there might be more ways I have not set yet.
I will demo the two ways I have seen so far with pseudo script/coding examples. I might come back and add here later, if I come across more ways
Way2a)
_SomeThingsInThePipe | where { $_.Name –noteegaulto “Fred” } | hgIUdh………….
In that script/code snippet we have effectively looped to remove thee things that had the name of “Fred”
In that script/code snippet we have used for the first time the strange , $_ , which is the new PowerShell thing
This is used to access the current thing or object in the looping process.
So it is approximately equal to the Thing or $Thing in the previous examples:
Approximately
____________Thing = $Thing = $_
( Note: This Way2a) may be a debatable one. It suggest to me it’s a For-Each thing. Mostly it’s not indicated as such by others. Possibly the Where thing is an old SQL thing, and not generally regarded as a thing that loops. I am not sure: The use of the $_ suggested to me that we are in a loop)
Way2b)
In the last example, the use of where, may have indicated to PowerShell that we are wanting to do something in a loop to the things “passing in the pipe”.
We can also more explicitly indicate that we want to loop the things “passing in the pipe”. This then resembles the VBA and First PowerShell examples:
_SomeThingsInThePipe | ForEach ( {
___ $_.doingstuff
___ $SomethingElse = $_.Something
__ } )
I expect there is some inter changeability in using alternative ways, which I may come back to demonstrating later.
For now, with the gained knowledge I will go back to the script walkthrough and expanded explanations.
Process ManagerIntroduction:
So back to this “Process Manager”
( Process Manager - https://www.youtube.com/watch?v=GQSQ...EIiver&index=2
https://pastebin.com/b5VMrmz7
my version with expanded comments , Share ‘XS86Video2ProcessManager.ps1’ https://app.box.com/s/sig74y36c4tptmkumm62obznpef77iqz )
I am not intending a full walkthrough of that script, as this is just notes on some important parts for my later reference. This is an overview that may help the more detailed comment navigation of the script.
This first post will attempt to give an overview of the function to get the Processes complete with some detail, and then the nest post will look again in a bit more detail, and finally also cover the shorter function that stops the selected processes
Basic idea: What does the script do
This brings up inside a GUI, a ListView of a computers Processes, from which we could then select and stop some. https://i.postimg.cc/KKRqphDZ/Processes-Manager.jpg
ListView on a GUI##
The script lines for this are very similar for those for the GUI itself or for those for a Panel.
Basically it initially requires declaring a variable to a list view object, which then has its properties assigned in the usual OOP way.
These are the main first 3 lines,
$listview_Processes = New-Object System.Windows.Forms.ListView
$listview_Processes.Location = New-Object System.Drawing.Size(8, 40)
$listview_Processes.Size = New-Object System.Drawing.Size(800, 402)
, then there are a few self explanatory lines defining properties
, and then finally we have a controls .Add line
$Form_HelloWorld.Controls.Add($listview_Processes)
Functions to get the processes and to stop them
A couple of significant differences to VBA and PowerShell script in regards to functions
_ PowerShell script seems to not work as immediately as VBA.
_ The functions in PowerShell are within the main script itself
The result of this is that we need to put the functions at the top of the main script: They need to be passed through at least once. After that they are held in memory of the current open PowerShell shell/window session. (**It seems OK to use variables in the function which are not yet declared: Our variable for the Listview,
$listview_Processes = New-Object System.Windows.Forms.ListView
, is not declared until later down in the script )
Function GetProcesses{
}
Function GetProcesses{
We start with some clearing of the $Listview_Processes object variable , even though at the top of the script , that variable has not been declared or set to anything yet**
We use a variable, $Processes for a sub set of the things in computer’s processes , ( they might actually be all of them ). I think them that we obtain an array of all those processes.
In some way that is not completely clear to me, a script line like this,
$AProcessProperties = $Processes[0].psObject.Properties
, is returning me something that has, possibly amongst other things, the typical headings for the first Processes. ( I think using the first Process , item 0 , is arbitrary. Any process would do )
# Make “columns”
I think adding a “column” is based on a more abstract part of making the Listview.
The script line uses the word Column, which is a bit strange, as the corresponding word row does not exist. ( Neither does the word record. Instead we have Item later where we might have expected row or record)
This word Column might have been just as inappropriate as the word Field, so god knows why Column was used, other than perhaps no one really knows what’s going on, Lol
It seems that we use Way2b) of a ForEach loop to Add the “Columns”, and this is done by giving some text name which effectively becomes the column or field header, in other words what appears across the top.
So the loop is a ForEach applied to our first Process variable, $AProcessProperties
____$AProcessProperties | ForEach-Object ( {
_____ $listview_Processes.Columns.Add("$($_.Name)")
____} )
As ever we are flexible with the syntax, and the following is exactly the same
__$AProcessProperties | ForEach-Object ( {$listview_Processes.Columns.Add("$($_.Name)")} )
__The next part is the remaining main script to fill the list view.
It comprises of a main Outer ForNext loop ######## , and then an Inner loop, -------##. Based on my explanations in the last post, in particular for way2a) , the inner loop section could be considered as two loops, one after the other
Filling “rows” of data.
The filling of “rows” in the listview is a slightly vague concept, similar to that for adding the “columns”, but at first glance the two concepts seem a bit mismatched:
So far we have a seemingly equally important set of headings. But as we move on now, to fill the rows, it seems that the first column has some sort of higher significance.
It’s a bit weird:
The main outer loop is reasonably clear, the rest is a bit weird. The main outer loop is all the processes,
__ ForEach ($Process in $Processes){ ########
__ } _______________________________ ########
That makes sense: A row for a process
The column filling is a bit weird. It seems as if a “row” is considered an Item but that Item can be text or any unique number, like the left most column in an Excel spreadsheet, except that it does not have to be sequential numbers** and, this is the most peculiar, at the top of this first column is the first header value. That is weird. That is as if, for example our Excel spreadsheet looked like thisSo in the script that I am walking through, it looks like we try to make that first column look like a normal first column, then add the other column values. Weird!
header1 Header 2 A Header Last Column Header 345 232 36
Just to confuse things a bit more, we can actually access later the “row” or Items by sequential number that starts at zero and goes down like, pseudo this strange situation
# Make a “row”s( Item )######################## MAIN Script LOOP
header1 Header2 A Header Last Column Header0\345 1\232 2\36
So far, (what we have already done: it appears that the Column(headers) some how belong to the .Net Forms thing which were defined in the initial script lines## for the variable $listview_Processes
$listview_Processes = New-Object System.Windows.Forms.ListView
$listview_Processes.Location = New-Object System.Drawing.Size(8, 40)
$listview_Processes.Size = New-Object System.Drawing.Size(800, 402)
So that object thing has somehow “columns” as part of it.
But now as we move on, it appears that we must make a new object thing for each for each row , and add that to the ListView
Best recap that again: make a ListView
_ Make a ListView object, add that object to the form, add columns to the ListView object
_ __ For Each row you want ( {
_____ make a ListView”row”(Item) object, add that object to the ListView object } )
So its all a bit crazy and mental. Never mind. Onward
So the main outer loop ####### on the script is for all “rows”, and it starts with
___ ForEach ($Process in $Processes)
, and then the next line is the object thing that we need to make a “row” ( Item )
____ $ProcessListViewItem = New-Object System.Windows.Forms.ListViewItem(
This seems to need some identifier, and will be the “left margin” number so we choose it for convenience to be what we want in the first column. So this may be a fiddle to use that “left margin” identifying “Item” as a normal column ………….System.Windows.Forms.ListViewItem( $Process.Id)
At this point we effectively have an object thing which need to be added to in order to give it the entire “row”/ record data. The obscure way this is done is by adding to the Item , “sub items”.
## SubItems ##--
It would appear that what we perceive as the columns from the second column, are regarded in the obscure PowerShell syntax as SubItems
As this is all getting a bit crazy, and the main loop introduces a lot of even more crazy and obscure PowerShell object concepts so we had best start a new post for it.
This schematic attempts to summarise the situation, but we will go into this and the functions again in more detail in the next post
__
header1 header2 A Header Last Header <-- This bit with the created “column” is part of the main ListView object 0\ 345SubItem SubItem SubItem <-- This brown thing is a ListViewItem object. It has an Item number of 0,
and an Item identifier/name of 345Item 0 1\ 232SubItem SubItem SubItem <-- This blue thing is a ListViewItem object. It has an Item number of 1,
and an Item identifier/name of 232Item 1 2\ 36SubItem SubItem SubItem <-- This purple thing is a ListViewItem object. It has an Item number of 2
and an Item identifier/name of 36Item 2
In the above schematic we are showing 4 objects. The last three belong to the first one, ( after they have been ned to it ).
The values in the first column somehow belong to the main ListView object.
SubItems are Added to the ListViewItems