This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function Remove-ApplicationByDisplayName | |
| { | |
| <# | |
| .SYNOPSIS | |
| Remove an application from Windows | |
| .DESCRIPTION | |
| Will accept a DisplayName value that will be searched for in Programs and Features and will | |
| uninstall the applicationg. | |
| .PARAMETER DisplayName | |
| The DisplayName as it found in Programs and Features |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [System.IO.Path]::GetInvalidFileNameChars() | % {$text = $text.replace($_,'.')} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-ArpPropertyByDisplayName { | |
| <# | |
| .SYNOPSIS | |
| Get an application property from Programs and Features | |
| .DESCRIPTION | |
| Will accept a DisplayName value that will be searched for in Programs and Features and will | |
| return the property. | |
| .PARAMETER DisplayName | |
| The DisplayName as it found in Programs and Features | |
| .NOTES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CommandString { | |
| [String]$Command | |
| CommandString([String]$Command) | |
| { | |
| $this.Command = $Command | |
| } | |
| [String] ToUninstall() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Uninstall an application based on the exact name in Programs and Features | |
| .DESCRIPTION | |
| Will accept a DisplayNamee value that will be searched for in Programs and Features. | |
| .PARAMETER DisplayName | |
| The DisplayName as it found in Programs and Features | |
| .PARAMETER LogPath | |
| [Optional] Full path to the client logs folder | |
| .PARAMETER LogName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def sumInRange(nums, queries) | |
| sum = 0 | |
| startIndices = {} | |
| endIndices = {} | |
| m = 1000000007 | |
| queries.each do |q| | |
| startIndices[q[0]].nil? ? startIndices[q[0]] = 1 : startIndices[q[0]] += 1 | |
| endIndices[q[1]].nil? ? endIndices[q[1]] = 1 : endIndices[q[1]] += 1 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Add-Numbers($a, $b) { | |
| return $a + $b | |
| } | |
| Describe "Add-Numbers" { | |
| $testCases = @( | |
| @{ a = 2; b = 3; expectedResult = 5 } | |
| @{ a = -2; b = -2; expectedResult = -4 } | |
| @{ a = -2; b = 2; expectedResult = 0 } | |
| @{ a = 'two'; b = 'three'; expectedResult = 'twothree' } |
NewerOlder