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
#PowerShell v3 | |
#02/06/2016 | |
Clear-Host | |
Sleep(1) | |
Write-Host " _______ ___ __ " -ForegroundColor DarkGreen | |
Sleep(1) | |
Write-Host "|#######| |###||##| " -ForegroundColor Green | |
Sleep(1) | |
Write-Host "|### ___| |###||__| " -ForegroundColor DarkGreen | |
Sleep(1) |
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
$xml = [xml]@' | |
<Users> | |
<User Name="Foo"> | |
<Friends> | |
<Friend Name="Bar"/> | |
</Friends> | |
</User> | |
<User Name="Foo2" /> | |
<User Name="Foo3"> | |
<Friends> |
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
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
[void] [System.Windows.Forms.Application]::EnableVisualStyles() | |
$Form = New-Object system.Windows.Forms.Form | |
$Form.Size = New-Object System.Drawing.Size(250,300) | |
$Form.Text = "Tools" | |
$Icon = New-Object system.drawing.icon ("C:\Program Files (x86)\ASUS\ASUS Smart Gesture\DesktopManager\resource\WindowStoreApp.ico") | |
$Form.Icon = $Icon | |
$Form.AutoSize = $True |
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
############################## | |
# Installation OCS via GPO # | |
############################## | |
#Auteur : atao | |
#Date : 29/11/2016 | |
#Chemin du fichier d'Installation | |
$executable = "\\[Chemin réseau de l'executable]\OCS-NG-Windows-Agent-Setup.exe" | |
#Récupération de la version du fichier |
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
#RunInAdmin? | |
([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) |
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
#From http://www.scconfigmgr.com/2014/08/22/how-to-get-msi-file-information-with-powershell/ | |
function Get-MSIFileInformation | |
{ | |
param( | |
[parameter(Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
[System.IO.FileInfo]$Path, | |
[parameter(Mandatory=$true)] |
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
$OutputEncoding = [System.Text.Encoding]::UTF8 | |
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 |
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
$appname = @( | |
"*BingWeather*" | |
"*ZuneMusic*" | |
"*ZuneVideo*" | |
) | |
ForEach($app in $appname){ | |
Get-AppxPackage -Name $app | Remove-AppxPackage -ErrorAction SilentlyContinue | |
} |
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
net use x: "\\Path\fonts" | |
x: | |
xcopy /y *.ttf %systemroot%\fonts | |
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "font1 (TrueType)" /t REG_SZ /d "font1.ttf" /f | |
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "font2 (TrueType)" /t REG_SZ /d "font2.ttf" /f | |
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "font3 (TrueType)" /t REG_SZ /d "font3.ttf" /f | |
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "font4 (TrueType)" /t REG_SZ /d "font4.ttf" /f |
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 | |
#OneLine | |
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit } | |
#Or | |
$Loc = Get-Location | |
"Security.Principal.Windows" | % { IEX "( [ $_`Principal ] [$_`Identity ]::GetCurrent() ).IsInRole( 'Administrator' )" } | ? { | |
$True | % { $Arguments = @('-NoProfile','-ExecutionPolicy Bypass','-NoExit','-File',"`"$($MyInvocation.MyCommand.Path)`"","\`"$Loc\`""); | |
Start-Process -FilePath PowerShell.exe -Verb RunAs -ArgumentList $Arguments; } } |
OlderNewer