{"id":7444,"date":"2023-08-04T14:17:06","date_gmt":"2023-08-04T14:17:06","guid":{"rendered":"https:\/\/www.iseepassword.com\/blog\/?p=7444"},"modified":"2023-10-16T07:28:14","modified_gmt":"2023-10-16T07:28:14","slug":"how-to-run-powershell-script-on-windows-server-2012-r2","status":"publish","type":"post","link":"https:\/\/www.iseepassword.com\/blog\/how-to-run-powershell-script-on-windows-server-2012-r2\/","title":{"rendered":"How to Run Powershell Script on Windows Server 2012 R2?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_69_1 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.iseepassword.com\/blog\/how-to-run-powershell-script-on-windows-server-2012-r2\/#Video_Tutorial_How_to_install_PowerShell_20_on_Windows_Server_2012_R2\" title=\"Video Tutorial: How to install PowerShell 2.0 on Windows Server 2012 R2?\">Video Tutorial: How to install PowerShell 2.0 on Windows Server 2012 R2?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.iseepassword.com\/blog\/how-to-run-powershell-script-on-windows-server-2012-r2\/#Where_is_PowerShell_in_Windows_Server_2012\" title=\"Where is PowerShell in Windows Server 2012?\">Where is PowerShell in Windows Server 2012?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.iseepassword.com\/blog\/how-to-run-powershell-script-on-windows-server-2012-r2\/#How_do_I_enable_PowerShell_script_on_server\" title=\"How do I enable PowerShell script on server?\">How do I enable PowerShell script on server?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.iseepassword.com\/blog\/how-to-run-powershell-script-on-windows-server-2012-r2\/#Is_PowerShell_50_is_included_with_Windows_Server_2012_R2\" title=\"Is PowerShell 5.0 is included with Windows Server 2012 R2?\">Is PowerShell 5.0 is included with Windows Server 2012 R2?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.iseepassword.com\/blog\/how-to-run-powershell-script-on-windows-server-2012-r2\/#What_version_of_PowerShell_is_available_for_Windows_2012_R2\" title=\"What version of PowerShell is available for Windows 2012 R2?\">What version of PowerShell is available for Windows 2012 R2?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.iseepassword.com\/blog\/how-to-run-powershell-script-on-windows-server-2012-r2\/#How_to_run_PowerShell_script_from_cmd\" title=\"How to run PowerShell script from cmd?\">How to run PowerShell script from cmd?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.iseepassword.com\/blog\/how-to-run-powershell-script-on-windows-server-2012-r2\/#How_to_open_PowerShell_ISE_in_Windows_Server_2012_R2\" title=\"How to open PowerShell ISE in Windows Server 2012 R2?\">How to open PowerShell ISE in Windows Server 2012 R2?<\/a><\/li><\/ul><\/nav><\/div>\n<p>Running PowerShell scripts on Windows Server 2012 R2 can be a powerful way to automate various tasks and streamline your workflow. PowerShell is a command-line shell and scripting language developed by Microsoft, specifically designed for system administration. In this tutorial, we will guide you through the steps of running PowerShell scripts on Windows Server 2012 R2.<\/p>\n<p><strong>Step 1:<\/strong> Launch the PowerShell Console<br \/>\nOpen the start menu and search for &#8220;Windows PowerShell.&#8221; Click on the PowerShell icon to launch the PowerShell console.<\/p>\n<p><strong>Step 2:<\/strong> Set Execution Policy<br \/>\nBy default, the execution policy restricts running PowerShell scripts on a Windows Server. To enable script execution, you need to change the execution policy.<\/p>\n<p>Type the following command in the PowerShell console and press Enter:<br \/>\n&#8220;`<br \/>\nSet-ExecutionPolicy RemoteSigned<br \/>\n&#8220;`<br \/>\nThis command allows the execution of locally created scripts or signed scripts from trusted publishers.<\/p>\n<p><strong>Step 3:<\/strong> Navigate to the Script&#8217;s Location<br \/>\nUse the `cd` (Change Directory) command to navigate to the directory where your PowerShell script is located. For example, if your script is in the &#8220;C:Scripts&#8221; directory, type the following command:<br \/>\n&#8220;`<br \/>\ncd C:Scripts<br \/>\n&#8220;`<\/p>\n<p><strong>Step 4:<\/strong> Run the PowerShell Script<br \/>\nTo run a PowerShell script, type the script&#8217;s filename with the &#8220;.ps1&#8221; extension and press Enter. For example, if your script is named &#8220;myscript.ps1,&#8221; type the following command:<br \/>\n&#8220;`<br \/>\n.myscript.ps1<br \/>\n&#8220;`<br \/>\nPress Enter to execute the script. The output of the script will be displayed in the PowerShell console.<\/p>\n<p><strong>Step 5:<\/strong> Execution Policy Changes (Optional)<br \/>\nAfter running the script, you may want to revert the execution policy to its original state for security reasons. To reset the execution policy to its default value, type the following command and press Enter:<br \/>\n&#8220;`<br \/>\nSet-ExecutionPolicy Restricted<br \/>\n&#8220;`<br \/>\nThis command restores the default execution policy, which only allows the execution of PowerShell commands.<\/p>\n<table>\n<tr>\n<th>Pros<\/th>\n<th>Cons<\/th>\n<\/tr>\n<tr>\n<td>1. Allows automation and scripting of various tasks.<\/td>\n<td>1. Executing scripts without proper understanding can pose security risks.<\/td>\n<\/tr>\n<tr>\n<td>2. Provides greater control and flexibility compared to GUI-based tools.<\/td>\n<td>2. Writing scripts may require learning PowerShell syntax and commands.<\/td>\n<\/tr>\n<tr>\n<td>3. Scripts can be reused and shared across multiple machines.<\/td>\n<td>3. Debugging scripts can be more challenging compared to GUI-based tools.<\/td>\n<\/tr>\n<\/table>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Video_Tutorial_How_to_install_PowerShell_20_on_Windows_Server_2012_R2\"><\/span>Video Tutorial: How to install PowerShell 2.0 on Windows Server 2012 R2?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Where_is_PowerShell_in_Windows_Server_2012\"><\/span>Where is PowerShell in Windows Server 2012?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In Windows Server 2012, PowerShell is a powerful command-line shell and scripting language that is built on top of the .NET framework. Its primary function is to automate administrative tasks and provide a more efficient way to manage and control the server environment.<\/p>\n<p>To locate PowerShell in Windows Server 2012, you can follow these steps:<\/p>\n<p>1. Click on the &#8220;Start&#8221; button or press the Windows key on your keyboard to open the Start Menu.<\/p>\n<p>2. In the Start Menu, locate the &#8220;Windows PowerShell&#8221; folder. It is usually found in the &#8220;Windows Administrative Tools&#8221; section. You can either scroll through the list or use the search bar to find it quickly.<\/p>\n<p>3. Click on the &#8220;Windows PowerShell&#8221; folder to expand it.<\/p>\n<p>4. Within the folder, you will find two options: &#8220;Windows PowerShell&#8221; and &#8220;Windows PowerShell ISE&#8221; (Integrated Scripting Environment). The former represents the standard PowerShell command-line interface, while the latter offers an enhanced scripting environment with additional features like syntax highlighting and debugging.<\/p>\n<p>5. Choose the appropriate option depending on your needs. If you&#8217;re just starting with PowerShell, the standard command-line interface should suffice.<\/p>\n<p>By following these steps, you will be able to locate and access PowerShell in Windows Server 2012, allowing you to leverage its powerful features for system administration and automation tasks.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_do_I_enable_PowerShell_script_on_server\"><\/span>How do I enable PowerShell script on server?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To enable PowerShell script on a server, you need to follow these steps:<\/p>\n<p>1. Open PowerShell as an administrator: Right-click on the Start menu button and select &#8220;Windows PowerShell (Admin)&#8221; from the context menu.<\/p>\n<p>2. Check the Execution Policy: Run the command `Get-ExecutionPolicy` to see the current execution policy. By default, it is likely set to &#8220;Restricted,&#8221; which prevents the execution of PowerShell scripts.<\/p>\n<p>3. Change the Execution Policy: To allow script execution, run the command `Set-ExecutionPolicy RemoteSigned`. This execution policy only allows the execution of scripts signed by trusted publishers. However, it allows the execution of local scripts without requiring a digital signature.<\/p>\n<p>4. Confirm the execution policy change: After setting the execution policy, run `Get-ExecutionPolicy` again to verify that it shows &#8220;RemoteSigned.&#8221;<\/p>\n<p>5. Run PowerShell scripts: Now, you can run PowerShell scripts on the server. To execute a script, open PowerShell, navigate to the script&#8217;s location using the `cd` (change directory) command, and then run the script using its file name and extension (e.g., `.scriptName.ps1`).<\/p>\n<p>By following these steps, you can enable the execution of PowerShell scripts on your server without any security or permission issues. However, always exercise caution when running scripts from untrusted sources or those you have not thoroughly reviewed.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Is_PowerShell_50_is_included_with_Windows_Server_2012_R2\"><\/span>Is PowerShell 5.0 is included with Windows Server 2012 R2?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Yes, PowerShell 5.0 is included with Windows Server 2012 R2. It was released as part of the Windows Management Framework (WMF) 5.0 update, which included updates to PowerShell, Windows Management Instrumentation (WMI), and the Server Manager CIM Provider.<\/p>\n<p>Here are the steps to verify that PowerShell 5.0 is included with Windows Server 2012 R2:<\/p>\n<p>1. Open the Start menu or press the Windows key on your keyboard.<br \/>\n2. Type &#8220;PowerShell&#8221; in the search bar and open the &#8220;Windows PowerShell&#8221; or &#8220;Windows PowerShell ISE&#8221; application.<br \/>\n3. Once the PowerShell console or ISE opens, type the following command and press Enter:<br \/>\n   &#8220;`<br \/>\n   $PSVersionTable.PSVersion<br \/>\n   &#8220;`<br \/>\n4. The output will display the version of PowerShell installed on your system. If it shows as 5.0 or higher, then PowerShell 5.0 is included with Windows Server 2012 R2.<\/p>\n<p>Note: PowerShell versions can also be checked from the &#8220;Programs and Features&#8221; section in the Control Panel of Windows Server 2012 R2. Look for &#8220;Windows Management Framework 5.0&#8221; or &#8220;Windows Management Framework 5.1&#8221; under the installed programs list to verify the installed version of PowerShell.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_version_of_PowerShell_is_available_for_Windows_2012_R2\"><\/span>What version of PowerShell is available for Windows 2012 R2?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>PowerShell is a powerful task automation and configuration management framework developed by Microsoft. When it comes to Windows Server 2012 R2, it includes a pre-installed version of PowerShell. Here&#8217;s the version information.<\/p>\n<p>Windows Server 2012 R2 comes with PowerShell version 4.0 by default. PowerShell 4.0 introduced several new features and enhancements over its predecessor, such as Desired State Configuration (DSC), enhanced debugging capabilities, and improved language support.<\/p>\n<p>To verify the installed PowerShell version on Windows Server 2012 R2, you can follow these steps:<\/p>\n<p>1. Launch PowerShell: Click on the Start button or press the Windows key, type &#8220;PowerShell,&#8221; and click on &#8220;Windows PowerShell&#8221; from the search results.<br \/>\n2. Run the command: In the PowerShell window, type the following command and press Enter:<br \/>\n   `$PSVersionTable.PSVersion`<\/p>\n<p>This command will display the PowerShell version information, including the major version, minor version, build version, and revision.<\/p>\n<p>Please note that while PowerShell version 4 is the default version on Windows Server 2012 R2, it is possible to upgrade PowerShell to a newer version manually if desired. However, this answer is based on the assumption that the server is running the default configuration without any additional updates or modifications.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_run_PowerShell_script_from_cmd\"><\/span>How to run PowerShell script from cmd?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To run a PowerShell script from the Command Prompt (cmd), you can follow these steps:<\/p>\n<p>1. Open the Command Prompt: Press the Windows key, type &#8220;Command Prompt,&#8221; and click on the application when it appears in the search results.<\/p>\n<p>2. Navigate to the directory containing the PowerShell script: Use the &#8220;cd&#8221; command to change the directory to where the script is located. For example, if the script is located in &#8220;C:Scripts,&#8221; type `cd C:Scripts` and press Enter.<\/p>\n<p>3. Run the PowerShell script: Once you&#8217;re in the correct directory, you can execute the PowerShell script by entering the following command:<\/p>\n<p>   &#8220;`<br \/>\n   powershell -File scriptname.ps1<br \/>\n   &#8220;`<\/p>\n<p>   Replace &#8220;scriptname.ps1&#8221; with the actual name of your PowerShell script, including the file extension.<\/p>\n<p>4. Press Enter to run the command, and the PowerShell script will execute.<\/p>\n<p>By following these steps, you&#8217;ll be able to run PowerShell scripts directly from the Command Prompt, allowing you to automate various tasks or perform specific operations easily.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_open_PowerShell_ISE_in_Windows_Server_2012_R2\"><\/span>How to open PowerShell ISE in Windows Server 2012 R2?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To open PowerShell ISE (Integrated Scripting Environment) in Windows Server 2012 R2, you can follow these steps:<\/p>\n<p>1. Launch the Start Menu: Click on the Windows logo located in the bottom-left corner of your screen or press the Windows key on your keyboard.<br \/>\n2. Search for PowerShell ISE: Begin typing &#8220;PowerShell ISE&#8221; in the search bar. As you type, the search results will start appearing.<br \/>\n3. Open PowerShell ISE: Once you see &#8220;Windows PowerShell ISE&#8221; in the search results, click on it to open the application.<\/p>\n<p>Alternatively, you can also use the Run dialog box to open PowerShell ISE:<\/p>\n<p>1. Press the Windows key + R on your keyboard simultaneously. This will open the Run dialog box.<br \/>\n2. In the Run dialog box, type &#8220;powershell_ise&#8221; (without quotes) and press Enter or click on the OK button.<\/p>\n<p>By following these steps, you should be able to open PowerShell ISE on Windows Server 2012 R2.<br \/>\n{&#8220;@context&#8221;:&#8221;https:\/\/schema.org&#8221;,&#8221;@type&#8221;:&#8221;FAQPage&#8221;,&#8221;mainEntity&#8221;:[{&#8220;@type&#8221;:&#8221;Question&#8221;,&#8221;name&#8221;:&#8221;Where is PowerShell in Windows Server 2012?&#8221;,&#8221;acceptedAnswer&#8221;:{&#8220;@type&#8221;:&#8221;Answer&#8221;,&#8221;text&#8221;:&#8221;In Windows Server 2012, PowerShell is a powerful command-line shell and scripting language that is built on top of the .NET framework. Its primary function is to automate administrative tasks and provide a more efficient way to manage and control the server environment.nnTo locate PowerShell in Windows Server 2012, you can follow these steps:nn1. Click on the &#8220;Start&#8221; button or press the Windows key on your keyboard to open the Start Menu.nn2. In the Start Menu, locate the &#8220;Windows PowerShell&#8221; folder. It is usually found in the &#8220;Windows Administrative Tools&#8221; section. You can either scroll through the list or use the search bar to find it quickly.nn3. Click on the &#8220;Windows PowerShell&#8221; folder to expand it.nn4. Within the folder, you will find two options: &#8220;Windows PowerShell&#8221; and &#8220;Windows PowerShell ISE&#8221; (Integrated Scripting Environment). The former represents the standard PowerShell command-line interface, while the latter offers an enhanced scripting environment with additional features like syntax highlighting and debugging.nn5. Choose the appropriate option depending on your needs. If you&#8217;re just starting with PowerShell, the standard command-line interface should suffice.nnBy following these steps, you will be able to locate and access PowerShell in Windows Server 2012, allowing you to leverage its powerful features for system administration and automation tasks.&#8221;}},{&#8220;@type&#8221;:&#8221;Question&#8221;,&#8221;name&#8221;:&#8221;How do I enable PowerShell script on server?&#8221;,&#8221;acceptedAnswer&#8221;:{&#8220;@type&#8221;:&#8221;Answer&#8221;,&#8221;text&#8221;:&#8221;To enable PowerShell script on a server, you need to follow these steps:nn1. Open PowerShell as an administrator: Right-click on the Start menu button and select &#8220;Windows PowerShell (Admin)&#8221; from the context menu.nn2. Check the Execution Policy: Run the command `Get-ExecutionPolicy` to see the current execution policy. By default, it is likely set to &#8220;Restricted,&#8221; which prevents the execution of PowerShell scripts.nn3. Change the Execution Policy: To allow script execution, run the command `Set-ExecutionPolicy RemoteSigned`. This execution policy only allows the execution of scripts signed by trusted publishers. However, it allows the execution of local scripts without requiring a digital signature.nn4. Confirm the execution policy change: After setting the execution policy, run `Get-ExecutionPolicy` again to verify that it shows &#8220;RemoteSigned.&#8221;nn5. Run PowerShell scripts: Now, you can run PowerShell scripts on the server. To execute a script, open PowerShell, navigate to the script&#8217;s location using the `cd` (change directory) command, and then run the script using its file name and extension (e.g., `.scriptName.ps1`).nnBy following these steps, you can enable the execution of PowerShell scripts on your server without any security or permission issues. However, always exercise caution when running scripts from untrusted sources or those you have not thoroughly reviewed.&#8221;}},{&#8220;@type&#8221;:&#8221;Question&#8221;,&#8221;name&#8221;:&#8221;Is PowerShell 5.0 is included with Windows Server 2012 R2?&#8221;,&#8221;acceptedAnswer&#8221;:{&#8220;@type&#8221;:&#8221;Answer&#8221;,&#8221;text&#8221;:&#8221;Yes, PowerShell 5.0 is included with Windows Server 2012 R2. It was released as part of the Windows Management Framework (WMF) 5.0 update, which included updates to PowerShell, Windows Management Instrumentation (WMI), and the Server Manager CIM Provider.nnHere are the steps to verify that PowerShell 5.0 is included with Windows Server 2012 R2:nn1. Open the Start menu or press the Windows key on your keyboard.n2. Type &#8220;PowerShell&#8221; in the search bar and open the &#8220;Windows PowerShell&#8221; or &#8220;Windows PowerShell ISE&#8221; application.n3. Once the PowerShell console or ISE opens, type the following command and press Enter:n   &#8220;`n   $PSVersionTable.PSVersionn   &#8220;`n4. The output will display the version of PowerShell installed on your system. If it shows as 5.0 or higher, then PowerShell 5.0 is included with Windows Server 2012 R2.nnNote: PowerShell versions can also be checked from the &#8220;Programs and Features&#8221; section in the Control Panel of Windows Server 2012 R2. Look for &#8220;Windows Management Framework 5.0&#8221; or &#8220;Windows Management Framework 5.1&#8243; under the installed programs list to verify the installed version of PowerShell.&#8221;}},{&#8220;@type&#8221;:&#8221;Question&#8221;,&#8221;name&#8221;:&#8221;What version of PowerShell is available for Windows 2012 R2?&#8221;,&#8221;acceptedAnswer&#8221;:{&#8220;@type&#8221;:&#8221;Answer&#8221;,&#8221;text&#8221;:&#8221;PowerShell is a powerful task automation and configuration management framework developed by Microsoft. When it comes to Windows Server 2012 R2, it includes a pre-installed version of PowerShell. Here&#8217;s the version information.nnWindows Server 2012 R2 comes with PowerShell version 4.0 by default. PowerShell 4.0 introduced several new features and enhancements over its predecessor, such as Desired State Configuration (DSC), enhanced debugging capabilities, and improved language support.nnTo verify the installed PowerShell version on Windows Server 2012 R2, you can follow these steps:nn1. Launch PowerShell: Click on the Start button or press the Windows key, type &#8220;PowerShell,&#8221; and click on &#8220;Windows PowerShell&#8221; from the search results.n2. Run the command: In the PowerShell window, type the following command and press Enter:n   `$PSVersionTable.PSVersion`nnThis command will display the PowerShell version information, including the major version, minor version, build version, and revision.nnPlease note that while PowerShell version 4 is the default version on Windows Server 2012 R2, it is possible to upgrade PowerShell to a newer version manually if desired. However, this answer is based on the assumption that the server is running the default configuration without any additional updates or modifications.&#8221;}},{&#8220;@type&#8221;:&#8221;Question&#8221;,&#8221;name&#8221;:&#8221;How to run PowerShell script from cmd?&#8221;,&#8221;acceptedAnswer&#8221;:{&#8220;@type&#8221;:&#8221;Answer&#8221;,&#8221;text&#8221;:&#8221;To run a PowerShell script from the Command Prompt (cmd), you can follow these steps:nn1. Open the Command Prompt: Press the Windows key, type &#8220;Command Prompt,&#8221; and click on the application when it appears in the search results.nn2. Navigate to the directory containing the PowerShell script: Use the &#8220;cd&#8221; command to change the directory to where the script is located. For example, if the script is located in &#8220;C:Scripts,&#8221; type `cd C:Scripts` and press Enter.nn3. Run the PowerShell script: Once you&#8217;re in the correct directory, you can execute the PowerShell script by entering the following command:nn   &#8220;`n   powershell -File scriptname.ps1n   &#8220;`nn   Replace &#8220;scriptname.ps1&#8243; with the actual name of your PowerShell script, including the file extension.nn4. Press Enter to run the command, and the PowerShell script will execute.nnBy following these steps, you&#8217;ll be able to run PowerShell scripts directly from the Command Prompt, allowing you to automate various tasks or perform specific operations easily.&#8221;}},{&#8220;@type&#8221;:&#8221;Question&#8221;,&#8221;name&#8221;:&#8221;How to open PowerShell ISE in Windows Server 2012 R2?&#8221;,&#8221;acceptedAnswer&#8221;:{&#8220;@type&#8221;:&#8221;Answer&#8221;,&#8221;text&#8221;:&#8221;To open PowerShell ISE (Integrated Scripting Environment) in Windows Server 2012 R2, you can follow these steps:nn1. Launch the Start Menu: Click on the Windows logo located in the bottom-left corner of your screen or press the Windows key on your keyboard.n2. Search for PowerShell ISE: Begin typing &#8220;PowerShell ISE&#8221; in the search bar. As you type, the search results will start appearing.n3. Open PowerShell ISE: Once you see &#8220;Windows PowerShell ISE&#8221; in the search results, click on it to open the application.nnAlternatively, you can also use the Run dialog box to open PowerShell ISE:nn1. Press the Windows key + R on your keyboard simultaneously. This will open the Run dialog box.n2. In the Run dialog box, type &#8220;powershell_ise&#8221; (without quotes) and press Enter or click on the OK button.nnBy following these steps, you should be able to open PowerShell ISE on Windows Server 2012 R2.&#8221;}}]}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Running PowerShell scripts on Windows Server 2012 R2 can be a powerful way to automate various tasks and streamline your workflow. PowerShell is a command-line shell and scripting language developed by Microsoft, specifically designed for system administration. In this tutorial, we will guide you through the steps of running PowerShell scripts on Windows Server 2012 [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7444","post","type-post","status-publish","format-standard","hentry","category-resources"],"_links":{"self":[{"href":"https:\/\/www.iseepassword.com\/blog\/wp-json\/wp\/v2\/posts\/7444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iseepassword.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iseepassword.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iseepassword.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iseepassword.com\/blog\/wp-json\/wp\/v2\/comments?post=7444"}],"version-history":[{"count":3,"href":"https:\/\/www.iseepassword.com\/blog\/wp-json\/wp\/v2\/posts\/7444\/revisions"}],"predecessor-version":[{"id":12357,"href":"https:\/\/www.iseepassword.com\/blog\/wp-json\/wp\/v2\/posts\/7444\/revisions\/12357"}],"wp:attachment":[{"href":"https:\/\/www.iseepassword.com\/blog\/wp-json\/wp\/v2\/media?parent=7444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iseepassword.com\/blog\/wp-json\/wp\/v2\/categories?post=7444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iseepassword.com\/blog\/wp-json\/wp\/v2\/tags?post=7444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}