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
| <# | |
| .EXAMPLE | |
| Write-RegistryValue -Path "HKCU:\Software\Sysinternals\Strings" -Name "EulaAccepted | |
| #> | |
| function Write-RegistryValue{ | |
| param ( | |
| [parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]$Path, | |
| [parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]$Name, | |
| [parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]$Value |
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
| <# | |
| .EXAMPLE | |
| Test-RegistryName -Path "HKCU:\Software\Sysinternals\Strings" -Name "EulaAccepted" | |
| #> | |
| function Test-RegistryName { | |
| param ( | |
| [parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]$Path, | |
| [parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]$Name | |
| ) |
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
| ########## | |
| # Win10 Post Setup Script | |
| # Original Author: Disassembler <disassembler@dasm.cz> | |
| # Edited by Sven212 | |
| # Version: 1.5, 2016-06-08 | |
| ########## | |
| # Ask for elevated permissions if required | |
| If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) { | |
| Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs |
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-EvengLog doesn't quite work I guess: | |
| # https://stackoverflow.com/questions/31396903/get-eventlog-valid-message-missing-for-some-event-log-sources# | |
| # Get-EventLog Application -EntryType Error -Source "DistributedCOM" | |
| # The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID | |
| #$logs = Get-EventLog -LogName "System" -EntryType Error -Source "DCOM" -Newest 1 -Message "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID*" | |
| # 2 is error | |
| # 3 is warning | |
| $EVT_MSG = "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID" | |
| # Search for System event log ERROR entries starting with the specified EVT_MSG | |
| $logEntry = Get-WinEvent -FilterHashTable @{LogName='System'; Level=2} | Where-Object { $_.Message -like "$EVT_MSG*" } | Select-Object -First 1 |
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 | |
| Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager | |
| .DESCRIPTION | |
| This module will return a [PSCredential] object from a credential stored in Windows Credential Manager. The | |
| Get-StoredCredential function can only access Generic Credentials. | |
| Alias: GSC |
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
| :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
| :Admin <Return> [Needed] [Success] | |
| :: Check for Administrator privileges and request privileges if Needed 'true'. | |
| :::: Usage: call :Admin xReturn true | |
| :: Return success value, if user is Admin. Default `true` if Success not set. | |
| setlocal | |
| set "xVBUAC=%Temp%\AdminUAC.vbs" | |
| set "xSuccess=true" | |
| set "xAdmin=false" | |
| if not "%~3"=="" set "xSuccess=%~3" |
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
| @echo off | |
| rem | |
| rem **************************************************************************** | |
| rem | |
| rem Copyright (c) Microsoft Corporation. All rights reserved. | |
| rem This code is licensed under the Microsoft Public License. | |
| rem THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF | |
| rem ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY | |
| rem IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR | |
| rem PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. |
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
| @echo off | |
| rem | |
| rem **************************************************************************** | |
| rem | |
| rem Copyright (c) Microsoft Corporation. All rights reserved. | |
| rem This code is licensed under the Microsoft Public License. | |
| rem THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF | |
| rem ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY | |
| rem IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR | |
| rem PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. |