Skip to content

Commit

Permalink
Code Formatting Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
og-mrk committed Jul 26, 2024
1 parent 03e3227 commit 1d6d0d6
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 222 deletions.
4 changes: 2 additions & 2 deletions functions/private/ConvertTo-Icon.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ function ConvertTo-Icon {
#>
param(
[Parameter(Mandatory=$true, position=0)]
[Parameter(Mandatory, position=0)]
[string]$bitmapPath,
[Parameter(Mandatory=$true, position=1)]
[Parameter(Mandatory, position=1)]
[string]$iconPath,
[Parameter(position=2)]
[bool]$overrideIconFile = $true
Expand Down
6 changes: 4 additions & 2 deletions functions/private/Get-Oscdimg.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
function Get-Oscdimg {
<#
.DESCRIPTION
This function will download oscdimg file from github Release folders and put it into env:temp folder
.EXAMPLE
Get-Oscdimg
#>
param( [Parameter(Mandatory=$true)]

param(
[Parameter(Mandatory, position=0)]
[string]$oscdimgPath
)

$oscdimgPath = "$env:TEMP\oscdimg.exe"
$downloadUrl = "https://github.com/ChrisTitusTech/winutil/raw/main/releases/oscdimg.exe"
Invoke-RestMethod -Uri $downloadUrl -OutFile $oscdimgPath
Expand Down
32 changes: 18 additions & 14 deletions functions/private/Get-TabXaml.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
function Get-TabXaml {
<#
.SYNOPSIS
Generates XAML for a tab in the WinUtil GUI
This function is used to generate the XAML for the applications tab in the WinUtil GUI
It takes the tabname and the number of columns to display the applications in as input and returns the XAML for the tab as output
.PARAMETER tabname
The name of the tab to generate XAML for
Note: the 'tabname' parameter must equal one of the json files found in $sync.configs variable
Otherwise, it'll throw an exception
.PARAMETER columncount
The number of columns to display the applications in, default is 0
.OUTPUTS
The XAML for the tab
.EXAMPLE
Get-TabXaml "applications" 3
.SYNOPSIS
Generates XAML for a tab in the WinUtil GUI
This function is used to generate the XAML for the applications tab in the WinUtil GUI
It takes the tabname and the number of columns to display the applications in as input and returns the XAML for the tab as output
.PARAMETER tabname
The name of the tab to generate XAML for
Note: the 'tabname' parameter must equal one of the json files found in $sync.configs variable
Otherwise, it'll throw an exception
.PARAMETER columncount
The number of columns to display the applications in, default is 0
.OUTPUTS
The XAML for the tab
.EXAMPLE
Get-TabXaml "applications" 3
#>


Expand Down
46 changes: 25 additions & 21 deletions functions/private/Get-WPFObjectName.ps1
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
function Get-WPFObjectName {
<#
.SYNOPSIS
This is a helper function that generates an objectname with the prefix WPF that can be used as a Powershell Variable after compilation.
To achieve this, all characters that are not a-z, A-Z or 0-9 are simply removed from the name.
.PARAMETER type
The type of object for which the name should be generated. (e.g. Label, Button, CheckBox...)
.PARAMETER name
The name or description to be used for the object. (invalid characters are removed)
.OUTPUTS
A string that can be used as a object/variable name in powershell.
For example: WPFLabelMicrosoftTools
<#
.SYNOPSIS
This is a helper function that generates an objectname with the prefix WPF that can be used as a Powershell Variable after compilation.
To achieve this, all characters that are not a-z, A-Z or 0-9 are simply removed from the name.
.EXAMPLE
Get-WPFObjectName -type Label -name "Microsoft Tools"
#>
.PARAMETER type
The type of object for which the name should be generated. (e.g. Label, Button, CheckBox...)
.PARAMETER name
The name or description to be used for the object. (invalid characters are removed)
param( [Parameter(Mandatory=$true)]
$type,
$name
)
.OUTPUTS
A string that can be used as a object/variable name in powershell.
For example: WPFLabelMicrosoftTools
.EXAMPLE
Get-WPFObjectName -type Label -name "Microsoft Tools"
#>

$Output = $("WPF"+$type+$name) -replace '[^a-zA-Z0-9]', ''
param(
[Parameter(Mandatory, position=0)]
[string]$type,

return $Output
[Parameter(position=1)]
[string]$name
)

}
$Output = $("WPF"+$type+$name) -replace '[^a-zA-Z0-9]', ''
return $Output
}
Loading

0 comments on commit 1d6d0d6

Please sign in to comment.