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
$adapter_name="Ethernet" | |
if ((Get-NetAdapter $adapter_name).InterfaceOperationalStatus -eq $true) {Disable-NetAdapter -Name $adapter_name -Confirm:$false} else {Enable-NetAdapter -Name $adapter_name -Confirm:$false} |
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
rem Run this with admin rights! | |
rem Запускать от имени администратора! | |
powershell -command "& {Set-ExecutionPolicy -ExecutionPolicy Restricted -Force}" | |
ftype Microsoft.PowerShellScript.1="C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe" "%%1" | |
assoc .ps1=Microsoft.PowerShellScript.1 | |
reg delete "HKCR\Microsoft.PowerShellScript.1\shell\runas" /f |
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
rem Run this with admin rights! | |
rem Запускать от имени администратора! | |
powershell -command "& {Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force}" | |
ftype Microsoft.PowerShellScript.1="C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe" "%%1" | |
assoc .ps1=Microsoft.PowerShellScript.1 | |
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ps1" /f | |
reg add "HKCR\Microsoft.PowerShellScript.1\shell\runas" /f | |
reg add "HKCR\Microsoft.PowerShellScript.1\shell\runas" /v "HasLUAShield" /t REG_SZ /f |
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 | |
Converts files to the given encoding. | |
Matches the include pattern recursively under the given path. | |
.EXAMPLE | |
Convert-FileEncoding -Include *.js -Path scripts -Encoding UTF8 | |
#> | |
function Convert-FileEncoding([string]$Include, [string]$Path, [string]$Encoding='UTF8') { | |
$count = 0 |