How to fix the font not changing in PowerShell on Windows 10

PowerShell lets you customize the font that it displays text in. It has a few specific fonts that you can choose from so you don’t have your entire fonts library at your disposal but these fonts are meant to work with a terminal which not all fonts are. Changing the font is easy and whatever you select can be set as the default font in PowerShell. If you’re trying to change the default font, and it won’t change, you might wonder what you’re doing wrong. This problem is actually a problem with the font you’re selecting.

Fix the font not changing in PowerShell

You can change the font that PowerShell uses by right-clicking the title bar and going to Properties or Default. There’s a Font tab in the window that opens where you can select a font and its size. If the changes you’re making on this window are not sticking i.e., PowerShell won’t remember them the next time you open the app, you will have to select a different font. When you do, PowerShell will remember it. This could be a problem with any font so try whichever one works and go with that. You can also install other fonts but make sure they will work with PowerShell before you install them.

To fix the font itself, you might have to download and install it all over again. It’s hard to say what might cause the problem with the font. When I had this problem, the font worked fine in other apps and PowerShell was able to use it for the current session. It only failed to use it when I quit the app and ran it again.

There’s also the fact that the font may not be available for download. These fonts tend to come pre-installed so you can’t go to popular font repositories and get them from there. What you can do is, if you have access to another Windows 10 PC, you can export the font from the other system and install it on the one you’re having PowerShell trouble with. It might work.

Another trick that’s worth trying is running PowerShell with admin rights and then changing its font. Strictly speaking, you don’t need admin rights to customize the look of PowerShell but it’s possible a problem with the font, now requires that you can change it only when you have admin access in PowerShell.

This does seem to be a recurring problem in PowerShell and it almost always turns out to be a problem with the font.

The post How to fix the font not changing in PowerShell on Windows 10 appeared first on AddictiveTips.

How to always run Command Prompt and PowerShell as Admin on Windows 10

Command Prompt and PowerShell can be run with admin rights, and with normal user rights. It goes without saying that if you run either of these command lines with admin rights, you can execute higher-level commands. With normal user rights, the commands that you can execute in either Command Prompt or PowerShell are tame. In many cases, you might even be blocked from running scripts. If you often need to open either or both these apps with admin rights and would like to skip using the context menu to do it, you can have Command Prompt and PowerShell always run as admin.

Limitations

This trick will work for a specific shortcut to Command Prompt and PowerShell. You must always use that shortcut to open these apps. Any other shortcut that you use or any other method that you use to open them will not result in them opening with admin rights. While, in theory, you can change this behavior for any and all instances of Command Prompt and PowerShell, it isn’t a good idea to do so since it will involve taking ownership of the EXEs for both apps, and that may lead to additional problems down the line.

To keep it simple, either pin Command Prompt and/or PowerShell to the Start Menu or, pin them to the taskbar.

Run Command Prompt as Admin

If you’ve pinned Command Prompt to the Start menu, right-click the tile and go to More>Open File Location. Right-click the Command Prompt shortcut that opens in a new folder. If you have a simple desktop shortcut, you can just right-click it provided you will always be using that shortcut to open Command Prompt.

Go to the Shortcut tab, and click Advanced. Select the ‘Run as administrator’ option, and click OK. Now, the next time you use this shortcut or tile to open Command Prompt, it will open with admin rights. You will still see the UAC prompt.

Run PowerShell as Admin

To always open PowerShell as admin, you will use more or less the same method that you did for Command Prompt. Locate the shortcut that you want to use to open PowerShell. Right-click it and select Properties from the context menu. Go to the Shortcut tab and click the Advanced button. Select the ‘Run as administrator’ option, and click OK, and then Apply. That’s all you need to do. Every time you use that same shortcut to open PowerShell, it will open with admin rights. You will still get the UAC prompt before the app actually opens.

The post How to always run Command Prompt and PowerShell as Admin on Windows 10 appeared first on AddictiveTips.

How to convert a PowerShell script to EXE on Windows 10

Scripts are great for when you have a very specific need that an app can’t meet. If you know how to write a script, or you’ve found the perfect one, it’s likely going to ease an everyday task for you. A script is great but it comes with some restrictions. Sometimes, it’s better if you have an EXE file to work with and you’d be surprised to know just how easy it is to convert a PowerShell script to an EXE file.

Convert PowerShell script to EXE

PS2EXE-GUI is a tool that gives you a GUI for converting a PowerShell script to an EXE file. All you really need is the script and an icon for the EXE to use. Getting an icon is super easy so pick something that suits your script, and then download and run PS2EXE-GUI.

In the Source field, select the script that you want to convert to an EXE. In the Target File field, enter a name for the output file and make sure it has an EXE file extension. In the Icon field, select the icon file that you created for your executable.

The other fields are pretty self-explanatory so go ahead and fill them out. There are no other settings that you need to change. Click ‘Compile’.

A PowerShell window will open and show the compilation process. It shouldn’t take too long but when it completes, you will see a message ‘Press Enter to leave:’. Tap the Enter key twice to close the PowerShell window. Visit the folder that had the script you converted and the converted EXE should be there.

The app will not create an installable program. When you run the EXE file, it will simply run the script as though it were run from the PS1 file. If the script was written to perform a certain function and then quit itself, the EXE will act the same. It will still act like the original script, it’s just in a different packaging.

With a PowerShell script in the EXE file format, it makes it much easier to run the script as part of an automation process. Not all automation tools may play nice with a script but EXEs are usually better supported. If you’re looking to distribute a script and don’t want inexperienced users tampering with it, distributing it as an EXE is probably a better idea.

Have a batch script that you want to convert to an EXE? It’s just as easy though results may vary depending on the script.

Read How to convert a PowerShell script to EXE on Windows 10 by Fatima Wahab on AddictiveTips – Tech tips to make you smarter

How to fix “running scripts is disabled on this system” in PowerShell on Windows 10

If you know how to write simple PowerShell or Batch scripts, you can automate quite a few things on Windows 10. In fact, even if you have to spend a little time writing the perfect script for something, the time saved once it’s good to go will be worth the time you spent writing it. That said, scripts can be dangerous which is when you try to run scripts in PowerShell, you get a rather long error message that essentially tells you “running scripts is disabled on this system”.

This is a security measure in PowerShell to prevent malicious scripts from running and potentially harming the system. Of course, a script that you’ve written yourself isn’t going to be malicious and should be able to run. To fix this problem, you need to change the execution policy in PowerShell. Here’s how.

Fix running scripts is disabled on this system

Open PowerShell with admin rights, and run the following command.

Get-ExecutionPolicy -List

This will show you the execution policy that has been set for your user, and for your machine. It’s likely that both, or at the very least the CurrentUser policy is set to Restricted.

To fix the “running scripts is disabled on this system” error, you need to change the policy for the CurrentUser. To do that, run the following command.

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Confirm that you want to make the change, and you will be able to run the script.

This should allow you to run most scripts however, if you’re still getting the same error, then you probably need to change the execution policy for the machine. You can modify the previous command to do so but you will need admin rights to do this.

Run this command.

Set-ExecutionPolicy RemoteSigned -Scope LocalMachine

Confirm that you want to make the change, and then try running the script.

This should do the trick if you’ve written the script yourself however, if you downloaded it online, and it isn’t signed, then you need to change the execution policy to Unrestricted. To do that, replace “RemoteSigned” in all of the above commands with “Unrestricted”. Be very careful which scripts you run if you’re downloading them. They can be dangerous.

Set-ExecutionPolicy

This is a fairly simple command for setting the execution policy on PowerShell. This command can have four different parameters, or states: Restricted, AllSigned, RemoteSigned, and Unrestricted.

The -Scope switch defines what the policy change is applied to. When you enter “CurrentUser”, it is applied to the current user only, and when you enter “LocalMachine”, it’s applied to the entire system

Read How to fix “running scripts is disabled on this system” in PowerShell on Windows 10 by Fatima Wahab on AddictiveTips – Tech tips to make you smarter

How to use the Cascadia Code font in Command Prompt on Windows 10

Fonts are made for different purposes; some look good on a restaurant menu, some look good on a website, some look good a business card, and comic sans looks bad everywhere. Some fonts are just easier to read than others and console apps are unlikely to use the same fonts that a word processor might. Command Prompt offers a modest selection of fonts that users can switch to. Microsoft has just released a brand new font for its new Terminal app called Cascadia Code. If you like it, you can install the Cascadia font in Command Prompt, and even PowerShell. Here’s how.

Install Cascadia Code

Cascadia Code is an open source TTF font. Go to its Github page and download it from the Releases tab. Once downloaded, you’re going to have to install it system wide in order to use it in Command Prompt or PowerShell.

To install the font, double-click the file and in the window that opens, click Install. Installation takes only a few seconds though you might have to authenticate with the admin account.

Cascadia Code font in Command Prompt

Now that the font has been installed, you can set Command Prompt to use it. Open Command Prompt and right-click the title bar. From the context menu, select ‘Properties’. Go to the Font tab, and look through the list of fonts under ‘Font’. Select Cascadia Code, and click OK. When you return to Command Prompt, it will be using the new font. Whenever you open it again, it will retain this setting.

You can do this for the current user, or for the admin user. It all depends on how you open Command Prompt.

Cascadia Code in PowerShell

To use Cascadia Code in PowerShell, you have to follow similar steps. Open PowerShell and right-click the title bar. From the context menu, select Properties.

Go to the Font tab, and look for Cascadia Code under the list of fonts in the Font section. Select it, and click OK. PowerShell will use Cascadia Code from this point forward.

You can change the font any time you want if you don’t like how it looks. Since Cascadia Code has been installed system wide, you will be able to use it in other apps that allow you to select a font. For word processors and/or design apps like Illustrator, Paint.net. and Photoshop, the font will be available for selection within the text tools.

This font was developed for the Terminal app so its focus is console users. You’re free to use it elsewhere but if it doesn’t look good in other projects, know that it isn’t exactly made for them.

Read How to use the Cascadia Code font in Command Prompt on Windows 10 by Fatima Wahab on AddictiveTips – Tech tips to make you smarter