Category "powershell"

How to fix error- nodemon.ps1 cannot be loaded because running scripts is disabled on this system, (without security risk)?

Error on terminal: nodemon.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:

How to enable / disable web application compression via command line?

I'm running iis 10 on windows server 2016. I need to enable content compression for some web application and disable it for others. These check boxes specifical

Why won't Variable update?

I'm currently editing our new employee script for AD and I am running into an issue, I added 2 radio buttons for the home folder, one radio button will update t

How can I compare a file's SHA256 hash in PowerShell to a known value?

If I've downloaded a file with a known SHA256 hash, how can I use PowerShell to check that the file matches the expected hash?

How to sudo on powershell on Windows

Whenever I need to run a powershell script it complains of security, if I add powershell.exe -nologo -executionpolicy bypass -File .\install.ps1 I still get per

How do I overwrite a file using PowerShell?

New-Item -Path "C:\aws" -Name "script.ps1" -ItemType "file" -Value "text in file" I am trying to create a file using the above command, if the file already exi

Task scheduler to run tasks only during the last full workweek of the month

I have multiple tasks that need to be scheduled during the last full workweek (Monday through Friday) of every month. These will be scheduled from a Windows Ser

TaskScheduler: "Access is Denied" (0x80070005) when running scheduled tasks on Windows Server 2019

I just set up a new Windows Server 2019 instance, and am trying to run tasks (C# console apps) through Windows Task Scheduler. I've set it up to log in as a cer

PowerShell - Automate loading .pst files into Outlook and exporting individual .msg items inside

I am currently working on a project where I have been given a lot of .pst files. These files contain individual .msg files inside which I need to run an analysi

'this.Client.SubscriptionId' cannot be null

We noticed that our Azure Subscription field is empty eg: Get-AzContext -ListAvailable Name Account Subscrip

Mapped network drives are not showing in My Computer

I am trying to create a external network drive using PowerShell 5.0. I Need those drive to display in My Computer. For that purpose I am using this follow comma

Invoke-Command with -credentials

I want to invoke a command on a remote server, I do not want to have to put in the password to run the script. I've tried encrypting the password and storing it

reads variable from a text file and set it to current PowerShell session env variable

let's say that I have a text file that defines some variables something like this file : .env USER=user DB_NAME=userDB DB_HOST=localhost DB_PORT=5432 and I wa

The term '\venv\Scripts\activate.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program

I have been trying to get a venv to activate for the last week. Currently, the errors say The module 'venv' could not be loaded. For more information, run 'Impo

Installing Dolt on Windows 10

I was trying dolt out for windows for a project ran into this error Access to the path 'C:\ProgramData\chocolatey\lib-bad' is denied. I think its was permission

How to create a JSON body with PowerShell which is Deserializable by .NET6 when using az rest to call a .NET6 Azure Function

We are using AzureCLI to be able to call an Azure Function endpoint upon a successful deployment. The call to get token works and the call to our azure functio

Powershell: Using Get-ChildItem with variables

I am writing a script that will iterate through folders, grabbing substrings of the folder names as variable values, and then iterate through the log files in e

Understanding Powershell: example - Convert JSON to CSV

I've read several posts (like Convert JSON to CSV using PowerShell) regarding using PowerShell to CSV. I have also read that it is relatively poor form to use

Programmatically change Keyboard Layout

I work in a Swiss company environment with de-CH as the standard keyboard-layout, while using a de-DE keyboard. I'm able to change my keyboard settings manuall

Windows10 Powershell - Alarm, World Clock, Timer, Stopwatch?

Windows 10 has a decent little Application that lets you set multiple Alarms, World Clocks, Timers and Stopwatches. Powershell also has some Stopwatch function