This file contains 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
#Register OnIdle event to load PS moduless. | |
Register-EngineEvent -SourceIdentifier ([Management.Automation.PsEngineEvent]::OnIdle) -MaxTriggerCount 1 -Action { | |
Import-Module TabExpansion++ | |
#Import-Module FunctionExplorer | |
Import-Module VariableExplorer | |
Import-Module PSCodeAnalyzer.ISEAddin | |
Import-Module Altrive.ISEExtensions | |
#Remove current Job (No Need to get job result) | |
$EventSubscriber.Action | Remove-Job -Force -ErrorAction Ignore |
This file contains 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
#Create OS BaseImage VHD | |
function New-OSBaseImage | |
{ | |
[Cmdletbinding()] | |
param( | |
$VhdPath, | |
$OSImageName, | |
$MediaPath, | |
$VhdConfig, | |
$DismConfig, |
This file contains 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
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading; |
This file contains 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
$ErrorActionPreference = "Stop" | |
Set-StrictMode -Version Latest | |
$Script:PackageManager = $null | |
function Initialize-NuGetPackageManager | |
{ | |
[CmdletBinding()] | |
param ( | |
[hashtable] $Repositories = @{}, |
This file contains 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
#Requires -RunAsAdministrator | |
function Main | |
{ | |
$ErrorActionPreference = "Stop" | |
$VerbosePreference = "Continue" | |
#Target account to assign previlage | |
$svcAccount = "TestSvc" |
This file contains 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
#Requires -Version 3 | |
#Credential file path | |
$script:CredentialsFile = Join-Path $env:TEMP "SavedCredentials\Credentials.xml" | |
function Set-SavedCredential() | |
{ | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory)] |
This file contains 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
if([Environment]::Is64BitProcess){ | |
throw "64bitプロセス内だとDLLロードに失敗する" | |
} | |
$ErrorActionPreference = "Stop" | |
Add-Type -Path "${env:ProgramFiles(x86)}\CeVIO\CeVIO Creative Studio\CeVIO.Talk.RemoteService.dll" | |
[CeVIO.Talk.RemoteService.ServiceControl]::StartHost($true) >$null | |
$talker = New-Object CeVIO.Talk.RemoteService.InteroperableComponents.Talker |
This file contains 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
$ErrorActionPreference = "Stop" | |
#Need to install Nuget packages before execute | |
Add-Type -Path (Join-Path (Split-Path $profile -Parent) "packages\Windows7APICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll" -Resolve) | |
Add-Type -Path (Join-Path (Split-Path $profile -Parent) "\packages\Windows7APICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll" -Resolve) | |
<# | |
#TODO: Define Interop code to register shortcut with appid | |
$referencedAssemblies = @( | |
[MS.WindowsAPICodePack.Internal.PropVariant].Assembly.FullName, |
This file contains 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
#Requires –Version 3 | |
#Get WindowsUpdate List for offline patch | |
function Get-WindowsUpdateFileList | |
{ | |
param( | |
[Parameter(Mandatory=$True)] | |
[string] $Filter | |
) | |
$objSession = New-Object -ComObject "Microsoft.Update.Session" |
This file contains 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-EventLogError | |
{ | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory,ParameterSetName="FromLastBootupTime")] | |
[switch] $FromLastBootupTime, | |
[Parameter(Mandatory,ParameterSetName="FromLastQueryTime")] | |
[switch] $FromLastQueryTime, | |
[Parameter(Mandatory,ParameterSetName="Range")] | |
[DateTime] $From, |