Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

windows install chocolatey

# Run Powrshell as admin

Copy Paste this

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Comment

how to install chocolatey on windows 10

# COPY AND PASTE THIS COMMAND 

# using cmd as admin
@"%SystemRoot%System32WindowsPowerShellv1.0powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateyin"

#or

#using powershell as admin
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Comment

chocolatey installation

@"%SystemRoot%System32WindowsPowerShellv1.0powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateyin"
Comment

install chocolatey

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Comment

install chocolatey on windows

@"%SystemRoot%System32WindowsPowerShellv1.0powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateyin"
Comment

chocolatey install

#Install Chocolatey
#region
echo "Setting up Chocolatey software package manager"
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT

Get-PackageProvider -Name chocolatey -Force

echo "Setting up Full Chocolatey Install"
Install-Package -Name Chocolatey -Force -ProviderName chocolatey
$chocopath = (Get-Package chocolatey | 
            ?{$_.Name -eq "chocolatey"} | 
                Select @{N="Source";E={((($a=($_.Source -split ""))[0..($a.length - 2)]) -join ""),"ToolschocolateyInstall" -join ""}} | 
                    Select -ExpandProperty Source)
& $chocopath "upgrade all -y"
choco install chocolatey-core.extension --force

echo "Creating daily task to automatically upgrade Chocolatey packages"
# adapted from https://blogs.technet.microsoft.com/heyscriptingguy/2013/11/23/using-scheduled-tasks-and-scheduled-jobs-in-powershell/
$ScheduledJob = @{
    Name = "Chocolatey Daily Upgrade"
    ScriptBlock = {choco upgrade all -y}
    Trigger = New-JobTrigger -Daily -at 2am
    ScheduledJobOption = New-ScheduledJobOption -RunElevated -MultipleInstancePolicy StopExisting -RequireNetwork
}
Register-ScheduledJob @ScheduledJob
#endregion

#Update Powershell
#region
$ErrorActionPreference = "silentlycontinue"

$PSVersionTable.PSVersion
choco install powershell -y
choco upgrade powershell -y

$ErrorActionPreference = "continue"
#endregion
Comment

PREVIOUS NEXT
Code Example
Shell :: kill task cmd 
Shell :: git stash show files changed 
Shell :: adonis js make seeder 
Shell :: find which process is using port mac 
Shell :: neovim install wsl 
Shell :: wget files matching pattern 
Shell :: nginx: invalid option: "restart" 
Shell :: git commit ignore eslint 
Shell :: kill a port in ubuntu 
Shell :: how to tar linux 
Shell :: connect emulator to localhost 
Shell :: chrome ubuntu 
Shell :: git test ssh 
Shell :: django gitignore 
Shell :: remove alias powershell 
Shell :: run powershell script at startup 
Shell :: linux version 
Shell :: remove all docker containers 
Shell :: add pg_config to path 
Shell :: install crate rust 
Shell :: check folders sizes linux 
Shell :: How to export a GPG private key to a file 
Shell :: arch linux 
Shell :: installing rspec gemfile 
Shell :: windows cd to another drive 
Shell :: How can i rename my local master branch to main ? 
Shell :: connect to specific wifi decive linux 
Shell :: wasm pack install 
Shell :: posh-git installation on PowerShell 
Shell :: matlab on ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =