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
| Param | |
| ( | |
| [Parameter(Mandatory = $true)] | |
| [String[]] $ComputerName, | |
| [String] $FilePath = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" | |
| ) | |
| $Filter = "Name='{0}'" -f $File.Replace('\','\\') | |
| Get-WmiObject -Class CIM_DataFile -ComputerName $ComputerName -Filter $Filter |
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
| @{ | |
| '6.1.7600' = '2.0' | |
| '6.2.9200.16434' = '3.0' | |
| '6.3.9600.17090' = '4.0' | |
| '6.3.9701.0' = '5.0 Preview April' | |
| '6.3.9740.0' = '5.0 Preview May' | |
| '6.4.9789.0' = '5.0 Preview July' | |
| '6.4.9814.0' = '5.0 Preview September' | |
| '6.4.9841.0' = '5.0 Windows 10 TP' | |
| } |
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
| Param | |
| ( | |
| [Parameter(Mandatory = $true)] | |
| [String] $ComputerName | |
| ) | |
| # S-1-5-32-544 is the well-known security ID for the Administrators group | |
| $LocalGroup = Get-WmiObject -Class Win32_Group -Filter "SID = 'S-1-5-32-544'" -ComputerName $ComputerName | |
| if ($LocalGroup) | |
| { |
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
| git config --global push.default simple | |
| git config --global pull.rebase true | |
| git config --global rerere.enabled true | |
| git config --global color.ui true | |
| git config --global alias.s "status -s" | |
| git config --global alias.lg "log --oneline --decorate --all --graph" |
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
| Configuration DCSERVER { | |
| Param ( | |
| [Parameter(Mandatory)] | |
| [PSCredential] | |
| $DomainAdministratorCredential, | |
| [Parameter(Mandatory)] | |
| [PSCredential] |
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
| $Splat = @{ | |
| Filter = '/system.webServer/security/authentication/windowsAuthentication' | |
| Metadata = 'overrideMode' | |
| Value = 'Allow' | |
| PSPath = IIS:\ | |
| Location = 'Default Web Site' | |
| } | |
| Set-WebConfiguration @Splat |
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
| # Get-DscResource -Module TestBug | Select-Object -ExpandProperty Properties | |
| # Un-comment the ValidateNotNullEmpty attribute to repro the bug | |
| enum Ensure | |
| { | |
| Present | |
| Absent | |
| } | |
| [DscResource()] |
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
| $Targetfolder ="C:\temp\logs" | |
| $Extension = "*.log" | |
| $logfile = New-Item -Path 'C:\TEMP' -ItemType "file" -Name deleted.log | |
| $files = Get-ChildItem $Targetfolder -Include $Extension -Recurse | where {$_.LastWriteTime -lt (get-date).Adddays(-180)} | |
| foreach ($File in $Files) | |
| { | |
| if ($File -ne $Null) | |
| { | |
| write-host "Deleting File $File" -BackgroundColor DarkGreen |
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
| Param | |
| ( | |
| [Parameter(Mandatory)] | |
| [System.String] | |
| $Path, | |
| [System.String] | |
| $Filter = '*.jpg', | |
| [System.String] |
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
| Set-ItemProperty -Path $defaultFTP -Name ftpServer.security.ssl.serverCertHash -Value 582EF84C1D431738C0A5F75C845CAA03D81E63B6 # Replace my sample thumbprint with the value from your certificate | |
| # Data channel ports are a per server configuration not per site | |
| Set-WebConfigurationProperty -PSPath IIS:\ -Filter system.ftpServer/firewallSupport -Name lowDataChannelPort -Value 5001 | |
| Set-WebConfigurationProperty -PSPath IIS:\ -Filter system.ftpServer/firewallSupport -Name highDataChannelPort -Value 5001 |