How to install apps from Command Prompt or PowerShell on Windows 11,10
If you are feeling headache going through the monotonous process of installing applications on Windows and would die for an alternative solution, then you have come to the right place. In this article, we introduce you to Chocolatey, a package manager that you can easily set up in Windows. After setting up this package manager in your machine, you can install almost any application directly from Command Prompt or PowerShell. More than just the ease factor, Chocolatey really gives you a tech feel. It is the command prompt after all!
Read on to learn all about Chocolatey and how to use it effectively to make your life easier.
Part 1: What is Chocolate
Chocolatey is a command line package manager that automates the entire process of software installation on your machine. You can use PowerShell and Command Prompt to run Chocolatey commands. ChocolateyThe best thing is that it is free and open source. There are many things you can do with Chocolatey. Using Chocolatey, we can install and uninstall software packages, we can upgrade existing applications, search for a specific application from the thousands of applications available in the Chocolatey software repository, and much more. We can also use Chocolatey to check the list of outdated software in the machine.
Section 2: How to Install the Chocolatey Package Manager
Chocolatey can be used in both Command Prompt and Windows PowerShell. In this section, we will explain how to install Chocolatey on your machine. The installation process of Chocolatey can also be done using PowerShell or using the command prompt.
Method 1: Through PowerShell
Step 1: Click the search icon on the .
Step 2: Now in the PowerShell search bar, enterPowerShell and click on the "Run as administrator" option as shown below.
Step 3: When the PowerShell window opens, first we need to ensure that the execution policy is not restricted. To view the execution policy set in the machine, copy and paste the following command and press Enter key.
获取执行策略
Step 4 : If the result of the previous step is Restricted, then you also needExecute the next command, otherwiseyou can skip this step and continue Step 5.
Set-ExecutionPolicy AllSigned
After executing the command, press Y or y and press the Enter keyconfirm Implement policy changes.
Step 5: Next, let’s execute the command to install Chocolatey on our machine.
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Copy and paste the above command and press Enter key.
Step 6: Wait for Chocolatey to install on your machine. After installation, your PowerShell screen will look like the screenshot below.
Step 7: Now open File Explorer and navigate to the following path to view the Chocolatey file in your machine folder.
这台 PC --> 本地磁盘 (C:) --> ProgramData --> Chocolatey
Alternatively, you can copy and paste the location C:\ProgramData\chocolatey onto the File Explorer navigation bar and press Enter key to reach the same position.
This is where Chocolatey is installed on your machine. If you can see this folder, the installation was successful and you can continue exploring Chocolatey features.
Step 8: Return to the PowerShell window and copy and paste the following commands to see all available Chocolatey commands.
巧克力-?
这就是您通过 PowerShell 窗口安装 Chocolatey 的方式。现在,如果您想通过命令提示符安装它,您可以按照以下步骤操作。
方法二:通过命令提示符
第 1 步:像往常一样,单击任务栏上的搜索图标。
第 2 步:现在在搜索栏中,输入cmd并单击命令提示符下的以管理员身份运行选项。
第 3 步:当命令提示符以提升模式打开时,复制并粘贴以下命令以在您的计算机中安装 Chocolatey。
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System. Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
按Enter键执行命令。
就是这样。上面的命令会在你的机器上安装 Chocolatey。稍等片刻,让它运行完成。
注意:我的机器里已经有 Chocolatey,这就是我得到以下屏幕的原因。但是,对您而言,如果您的机器中还没有安装 Chocolatey,它将使用第 3 步中的命令进行安装。
第 4 步:安装完成后,您可以复制并粘贴以下命令以查看 Chocolatey 可以为您做的事情的列表。
巧克力-?
第 3 部分:什么是 Chocolatey 包以及在哪里可以看到包存储库
Chocolatey 包包含有关包的所有数据,并且它们还包含一些附加数据,这些数据特定于 Chocolatey。我们使用 Chocolatey 包在我们的机器上安装应用程序。Chocolatey 有一个巨大的包存储库,其中包含数千个包。Chocolatey 存储库中提供的所有软件包都经过了彻底的验证、验证和病毒检查。Chocolatey 执行的更多检查也使包裹更加安全。
单击此处查看 Chocolatey 包存储库。当涉及到许多事情时,包存储库网站非常有用。下面列出了其中一些。
3.1 搜索包
通过使用包存储库搜索栏,您可以搜索包。
3.2 查找包的安装命令
如果您向下滚动网页,您会看到许多软件包,您将能够找到每个软件包的安装命令。
3.3 查找包的卸载命令
首先单击要为其查找卸载命令的包。
在特定于软件包的网页上,向下滚动以找到名为Deployment Method: Individual Install, Upgrade, & Uninstall的部分。
在这里,您必须单击名为“卸载”的选项卡才能查看卸载命令。
3.4 查找包升级命令
对于这个也是,首先单击要查找升级命令的包。
进入软件包页面后,向下滚动并找到名为Deployment Method: Individual Install, Upgrade, & Uninstall的部分。
在这里单击名为Upgrade的选项卡。在这里,您将能够轻松地看到升级命令。
3.5 如何判断一个包裹是否通过了巧克力测试
首先进入包裹特定的网页。您可以通过单击包存储库网页主页上的包名称来执行此操作。
现在,在特定于包裹的网页上,在顶部本身,您将能够看到包裹是否已通过所有验证和验证。
第 4 部分:如何从命令提示符或 Powershell 使用 Chocolatey 安装 Windows 软件
现在您的机器中有 Chocolatey,让我们看看如何使用它来使用 Chocolatey 安装不同的应用程序。您可以使用命令提示符和PowerShell来执行 Chocolatey 命令。在本文中,我们使用 PowerShell 来实现同样的目的。您可以打开PowerShell或命令提示符窗口,详见第 1 节。
第 1 步:要安装任何软件,您可以使用以下命令:
choco install [包名]
您必须将[package name]替换为您要安装的包的名称。
在下面的示例中,我正在使用 Chocolatey 安装 Adobe Reader。所以我的命令是choco install adobereader。如果您对包名有任何混淆,可以参考第 3 节,并使用搜索栏直接从 Chocolatey 包存储库网站获取所需应用程序的安装命令。
准备好命令后,按Enter键。
每当您被要求确认诸如您想运行脚本吗?
第 2 步:安装完成后,Chocolatey 会告诉你。
就是这样。您现在可以使用 Windows 搜索栏打开已安装的软件,就像启动任何软件一样。哦,是的,没有比这更简单的了。享受!
第 5 节:如何从命令提示符或 Powershell 使用 Chocolatey 卸载 Windows 软件
要使用 Chocolatey 卸载应用程序,该命令将采用以下格式。
choco卸载[包名]
将[package name]替换为实际的包名称。您可以按照第 3. 3 节轻松找到软件包的卸载命令。
第 6 节:如何在命令提示符或 Powershell 中使用 Chocolatey 搜索包
就像您可以使用包存储库网站搜索包一样,您也可以直接从命令提示符或 PowerShell 搜索包。
搜索包的命令将采用以下格式。
choco search [搜索关键字]
您必须将[搜索关键字]替换为您的实际关键字。
例如,如果您想使用关键字reader搜索包,那么您的搜索命令将是choco search reader。
执行此命令将列出Chocolatey 包存储库中所有可用的包,这些包的包名称中包含关键字reader。
第 7 节:如何从命令提示符或 Powershell 使用 Chocolatey 升级应用程序
当 Chocolatey 为您提供帮助时,升级应用程序再简单不过了。在 PowerShell 或命令提示符窗口中,执行升级命令以升级包。
任何软件包的升级命令都将采用以下格式。
choco升级【包名】
请记住将[package name]替换为实际的包名称。如果您对特定软件包的升级命令感到困惑,可以参考第3.4 节。
以下屏幕截图中给出了一个示例,Chocolatey 将升级名为adobereader的包。
第 8 节:如何使用 Chocolatey 查看过期包列表
您还可以选择查看通过 Chocolatey 安装的过时软件的完整列表。相同的命令如下。
巧克力过时
如果有一些过时的 Chocolatey 包,Chocolatey 将通过此命令列出它们,如果没有过时的包,那么您会收到来自 Chocolatey 的消息,说Chocolatey 已确定 0 个包已过时。
所以,这就是Chocolatey的全部内容。但是,当然,您可以探索更多关于 Chocolatey 的内容。
The above is the detailed content of How to install apps from Command Prompt or PowerShell on Windows 11,10. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Windows 11 is capable of running a large number of file types with or without external third-party applications. Not only does it allow you to perform numerous tasks from the comfort of your PC, but it also ensures that you can take advantage of your PC's raw capabilities. Today, we'll take a look at a complex file type—jar—and tell you how to open it on your Windows 11 or Windows 10 PC. What is a jar file? jar is an archive package format that may or may not contain an executable Java program. These archives can contain Java applications or source code, which can then be used to compile and run applications without having to write separate code for each application. You can use various methods

What is a CAB file? The extension of CAB file is .cab, which is the abbreviation of WindowsCabinet file. This is a compressed file typically used to compress software installation packages such as device drivers or update files. CAB files support lossless compression, which makes the format ideal for compressing files where it is critical that the files can be extracted accurately, such as drivers and other updates. How to Install a CAB File on Windows 11 Using Command Prompt There are multiple ways to install a CAB file on Windows 11. One of the methods is to use command prompt to extract and install the files. You can also use the newer Windows PowerShell

Cheating has always been a big problem in online FPS games, even if Valorant didn't exist. It can ruin the gaming experience and reduce player interest in the game. Valorant has tried to overcome this shortcoming since its early days with its own RiotVanguard protection system. You need to restart the system after installing the game once. This is completely normal and the Vanguard system will start automatically. However, if you restart your system and still see "Your game requires a system restart to play. Please restart your computer." Leave a message on the home page? Many users have encountered this problem, so don’t worry. Follow these fixes for a quick solution. Fix 1 – Don’t quit Pioneer after restarting your computer

Some users are encountering the error “Application Error 0xc0000906” while trying to run the application on their systems and they are unable to proceed. A single application or multiple applications on your system may encounter this error. This may be due to file corruption, caching issues, use of third-party antivirus software that may block software applications, etc. In this article, we have some solutions that can help users eliminate the error. Try executing the command to scan system files and disable antivirus software as described below. So let’s get started! Method 1: Run SFC and DISM Scan Step 1 – Open Command Prompt as Administrator. To do this, type cmd in the window search bar, then hold down the ctrl+shift keys and press enter

Many of our readers have reported the 0xC004C020 error when trying to connect their computers to their organization's servers. This error prevents activation of its Windows operating system. While errors can be frustrating, we'll guide you through error 0xC004C020 when trying to activate Windows on an organization-linked computer. What causes error 0xC004C020? If you are trying to activate Windows on an organization-linked computer and encounter error 0xC004C020, the possible causes may be as follows: Non-MAK keys – If a non-MAK key is used on an organization-linked computer, the organization’s policies will It is not allowed to be activated. Key access lost after formatting

Windows does a great job of allocating system resources to the processes and programs that need it most by assigning priorities to them. Most applications you install will run perfectly fine at the default "normal" priority level. Sometimes, however, you may need to run a program, such as a game, at a higher level than the default normal level to improve its performance. But this comes at a cost, and it's a deal worth pondering. What happens when you set an app to high priority? Windows has a total of six priority levels for running different processes and programs - low, below normal, normal, above normal, high and real-time. Windows will rank and queue applications based on their priority. The higher the priority, the application

For Windows users, there is nothing more annoying than having to face a blue screen error, especially one that is accompanied by a system crash. srttrail.txt error is one of them. While not technically a BSOD, bugs in your auto-repair environment are still symptoms of deeper issues derailing Windows and require intervention. What is srttrail.txt error? The srttrail.txt text file mentioned in the message is just a log maintained by Windows for all instances when it fails to start properly, and it will continue to appear if Windows gets stuck on startup. This error message mainly occurs at system startup, but may also occur in Windo

What is the System32 folder? System32 is one of the main folders used by Windows. During Windows installation, all necessary files and folders that are critical for the proper functioning of Windows are copied to this folder. These include important system files, related executable files used by Windows utilities, dynamic link libraries (DLLs), and even some software files are copied to this folder. However, don't be fooled by the name System32. This is true for both 32-bit and 64-bit computers. In a 64-bit machine, the System32 folder hosts the 64-bit files, while the 32-bit files are located in