Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decoupling xaml and ps1 #7

Merged
merged 2 commits into from
May 17, 2022
Merged

decoupling xaml and ps1 #7

merged 2 commits into from
May 17, 2022

Conversation

ssrahul96
Copy link
Contributor

@ssrahul96 ssrahul96 commented May 14, 2022

I hope this eliminates copy paste during development

You have assigned the entire Xaml to a variable $inputXML

Made changes to fetch the XAML content from MainWindow.xaml into the variable $inputXML (Read the file / url and load it as string)

for development uncomment the line

$inputXML = Get-Content "MainWindow.xaml" 

for production uncomment this line

$inputXML = (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/MainWindow.xaml")

I ve mentioned this trick in your youtube live session last week, but you have missed my chat :(

This was referenced May 14, 2022
@ChrisTitusTech ChrisTitusTech merged commit 7d4727b into ChrisTitusTech:main May 17, 2022
ChrisTitusTech added a commit that referenced this pull request May 17, 2022
* Fix issue in #14

 - It seems that Chris forgot to add a button for the Repair Windows Update Script and accidentally put it under the Default Windows Update Settings button.
   - Fixed by adding the $WPFFixesUpdate.Add_Click function before the Reset Script
   - Fixes #14

* decoupling xaml and ps1 (#7)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

Co-authored-by: Rahul Somasundaram <rahulstsgr@gmail.com>
Co-authored-by: Chris Titus <dfm.titus@gmail.com>
ChrisTitusTech added a commit that referenced this pull request May 17, 2022
* Add winget check and installer

 - Adds Check if winget is installed
   - If not installed, checks if the computer is running 1809+ and if the computer is running Windows Server or LTSC
    - If running pre-1809, winget install stops as it is not supported
    - If running Windows Server or Windows LTSC, runs alternative installer compatible with those editions of Windows

* decoupling xaml and ps1 (#7)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

Co-authored-by: Rahul Somasundaram <rahulstsgr@gmail.com>
Co-authored-by: Chris Titus <dfm.titus@gmail.com>
ChrisTitusTech added a commit that referenced this pull request May 17, 2022
* Update winutil.ps1

* Use Curl instead of Bits transfer for O&O Shutup.

* Update winutil.ps1

* decoupling xaml and ps1 (#7)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

Co-authored-by: Rahul Somasundaram <rahulstsgr@gmail.com>
Co-authored-by: Chris Titus <dfm.titus@gmail.com>
ChrisTitusTech added a commit that referenced this pull request May 18, 2022
* upload example

* decoupling xaml and ps1 (#7)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* Update README.md

* convert to runspaces

* add security updates to invoke-button

* Update README.md

removed extra text about test branch

* initial commit to test restmethod

* formatting

Co-authored-by: Rahul Somasundaram <rahulstsgr@gmail.com>
Co-authored-by: Chris Titus <dfm.titus@gmail.com>
ChrisTitusTech added a commit that referenced this pull request Sep 5, 2022
* xml decouple

* Typos: Documents, Start installs (#18)

Document -> Documents
Start install -> Start installs

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* Added DISM command and button to tool (#19)

* Added DISM command and button to tool

* Added additional scans and colours to make it clear when each scan type starts

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* Fix issue in #14 (#20)

* Fix issue in #14

 - It seems that Chris forgot to add a button for the Repair Windows Update Script and accidentally put it under the Default Windows Update Settings button.
   - Fixed by adding the $WPFFixesUpdate.Add_Click function before the Reset Script
   - Fixes #14

* decoupling xaml and ps1 (#7)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

Co-authored-by: Rahul Somasundaram <rahulstsgr@gmail.com>
Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* Add winget check and installer (#21)

* Add winget check and installer

 - Adds Check if winget is installed
   - If not installed, checks if the computer is running 1809+ and if the computer is running Windows Server or LTSC
    - If running pre-1809, winget install stops as it is not supported
    - If running Windows Server or Windows LTSC, runs alternative installer compatible with those editions of Windows

* decoupling xaml and ps1 (#7)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

Co-authored-by: Rahul Somasundaram <rahulstsgr@gmail.com>
Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* Small Fixes. (#22)

* Update winutil.ps1

* Use Curl instead of Bits transfer for O&O Shutup.

* Update winutil.ps1

* decoupling xaml and ps1 (#7)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

Co-authored-by: Rahul Somasundaram <rahulstsgr@gmail.com>
Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* upload example (#12)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* code format using powershell VS code extension (#28)

* Working runspaces (#32)

* upload example

* decoupling xaml and ps1 (#7)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* Update README.md

* convert to runspaces

* add security updates to invoke-button

* Update README.md

removed extra text about test branch

* initial commit to test restmethod

* formatting

Co-authored-by: Rahul Somasundaram <rahulstsgr@gmail.com>
Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* Fix bug in #39 (#40)

- Closes #39
  - $arch is not set to a value in the script, and it throws an error when the If-Statement is called
    - Fixed by replacing the $arch variable check with a wmic check

* Fix and Tweak #19 (#43)

* Fix Issue in #19

 - Pull Request #19 didn't add an entry for PanelDISM into MainWindow.xaml, causing an error to be thrown when the script if executed and a button to not be created
   - Fixed by adding an entry into MainWIndow.xaml that creates the needed button under the FixesUpdate button
   - Note: To see the fix, you need to comment line 9 and uncomment line 8 to use the local MainWindow.xaml instead of the one in the Main Branch

* Fix Formatting and Tweak Things

 - Fixed the formatting
 - Tweaked Write-Host's
   - Added newlines (`n) to space out the Statuses
   - Added progress indicators
     - Required "s and 's to be swapped so x/4 does not perform an operation

* Slight Tweak

* Added Uncheck all button in the Install tab (#29)

* Revert "Added Uncheck all button in the Install tab (#29)" (#72)

This reverts commit 8338371.

* Throw warning if no programs are selected for installation (#30)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* Fix a few spelling errors (#44)

- Fixed a few spelling errors
   - dependancies -> dependencies
   - Evnronment -> Environment
   - haved -> have
   - Hibernte -> Hibernate
   - histroy -> history
   - extentions -> extensions

* Arguments (#52)

* Implement Arguments

- Using $env:args, the script scans for arguments; then if found, Invokes the Runspace associated with said arg. Or in the case of the old panels, just opens the panel.
  - \b is to prevent mutual words from causing issues (Ex: Install and InstallUpgrade would conflict without \b)

* Actually add \b

Forgot to save before previous commit  : |

* Fix Order Issue

- The arg check occurred too early, causing an error

* Remove Invoke-Runspace

- Replaced Invoke-Runspace with Invoke-Command as there is no need to worry about the gui when running unattended

* Add Program Install Arg Check

 - Added arg check for Install
   - Format is 'Install: company.program,.company.program2'

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* Replace all instances of "incase" to "in case" (#60)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* Added  -NoRestart to WindowsOptionalFeature (#65)

* Handled UAC exit on install and upgrade (#31)

Co-authored-by: ChrisTitusTech <dfm.titus@gmail.com>
Co-authored-by: Ayoub Hebbaj <30575106+M3nti0nL3Ss@users.noreply.github.com>
Co-authored-by: Jards <jordancattwood@hotmail.com>
Co-authored-by: Carter <60557606+Carterpersall@users.noreply.github.com>
Co-authored-by: Rahul Somasundaram <rahulstsgr@gmail.com>
Co-authored-by: Aetopia <41850963+Aetopia@users.noreply.github.com>
Co-authored-by: DeveloperDurp <74198206+DeveloperDurp@users.noreply.github.com>
Co-authored-by: Rahul Somasundaram <ssrahul96@gmail.com>
Co-authored-by: GrahamboJangles <36944031+GrahamboJangles@users.noreply.github.com>
Co-authored-by: PWall <34860495+pwall2222@users.noreply.github.com>
@kAMENkitA kAMENkitA mentioned this pull request Oct 11, 2022
Carterpersall pushed a commit to Carterpersall/winutil that referenced this pull request Sep 29, 2023
* upload example

* decoupling xaml and ps1 (ChrisTitusTech#7)

Co-authored-by: Chris Titus <dfm.titus@gmail.com>

* Update README.md

* convert to runspaces

* add security updates to invoke-button

* Update README.md

removed extra text about test branch

* initial commit to test restmethod

* formatting

Co-authored-by: Rahul Somasundaram <rahulstsgr@gmail.com>
Co-authored-by: Chris Titus <dfm.titus@gmail.com>
ChrisTitusTech pushed a commit that referenced this pull request Aug 26, 2024
* Remove the Special Character Escaping for Json Files as there's no need for it anymore

* Simplify 'application.json' Json Prefix Addition in 'Compile.ps1' Script

Thanks to  @fam007e for improving this section in his PR #2587 changes

Co-authored-by: fam007e <faisalmoshiur@gmail.com>

---------

Co-authored-by: fam007e <faisalmoshiur@gmail.com>
ChrisTitusTech added a commit that referenced this pull request Aug 28, 2024
…lation (#2629)

* try1: apps panel

* refractor

- removed Get-TabXaml.ps1
- removed compilation part from compile.ps1
- removed existing changes from main.ps1
- added Invoke-WinUtilUIElements.ps1
- refractor existing changes into new function
- modified inputXML to call function

* removed unused replacementlogics

* fix toggle style

* move naming from winutil to wpf

* hotfixes

- reworked function calling
- working on correct theming support

* hotfix

* hotfix

fix missing elements
fix var naming

* some fixes

* hotfixes

* add image logic

* fix ? issue in search

* filter out unneeded categories

* cleanup

* fix border styling

* fixes

* preprocessing

* fix typo

* last fixes & add notes

* Update functions/public/Invoke-WPFUIElements.ps1

Co-authored-by: Mr.k <mineshtine28546271@gmail.com>

* fix margin

* fix tabcontent margin

* fix some other margin issues

* move fixed values outside of iterations

* little fix

* add Dispatcher.Invoke

* add error handling for styles

* Update functions/public/Invoke-WPFUIElements.ps1

Co-authored-by: Mr.k <mineshtine28546271@gmail.com>

* remove dispatcher

* fix search

* move run & undo tweaks to be fixed

* add error handling

* fix throw exception

* fixed accidental removal of findname grid call

* add padding & margin to make search look good

* remove grid to make it look correctly on small window

* fix rectangle

* Compiler Improvements for PR #2465 (#7)

* Remove the Special Character Escaping for Json Files as there's no need for it anymore

* Simplify 'application.json' Json Prefix Addition in 'Compile.ps1' Script

Thanks to  @fam007e for improving this section in his PR #2587 changes

Co-authored-by: fam007e <faisalmoshiur@gmail.com>

---------

Co-authored-by: fam007e <faisalmoshiur@gmail.com>

* fix margin of search clear

* fix cursor on clear search button

* undo fixed run & undo

* refractor themes.json

* undo themes.json

---------

Co-authored-by: Mr.k <mineshtine28546271@gmail.com>
Co-authored-by: fam007e <faisalmoshiur@gmail.com>
Co-authored-by: Chris Titus <contact@christitus.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants