Category "powershell"

How to suppress "keyboard-interactive" prompts in plink.exe

I have a PowerShell script that calls plink.exe regularly. Normally, the two output lines about keyboard-interactive prompts are simply annoying. However, when

Windows Power Shell doesn't recognize anything

I am starting the process to try and get my machine to run WSL 2, and I began by following the first step of a tutorial by Microsoft that asks you to run: dism.

Unable to get WindowsUpdateLog in Windows 2016

While trying to run Get-WindowsUpdateLog I get the error below. I come across a blog to copy SymSrv.dll file over to the server. This doesn't make sense as I ha

"No such file or directory" when synchronizing a local file with percent sign to remote directory with WinSCP

I have file with name %253csvg%2fonload=alert(1)%253e.jpg-131x94 I am trying to sync the files to remote server using WinSCP .NET assembly Session.SynchronizeD

Removing Members in Groups in Azure AD Powershell Automatically (App API Permission)

I'm trying to remove members of groups automatically via a PowerShell Script. There's an Azure AD app created, with User.ReadWrite.All (Application) and as User

How to speed up my SUPER SLOW search script

I am building a script to search for $name through a large batch of CSV files. These files can be as big as 67,000 KB. This is my script that I use to search th

How to parse/pipe cmd line output using Powershell to an object

I have an *.exe that outputs this data when I run this PowerShell command: & $myExe list Where $myExe is something like C:\Temp\MyExe.exe and list is an a

When generating a unique username in Active Directory, numbers do not increment correctly

I am updating a script we use to generate new users and update users based on a csv we download from a feed every night. I need to generate a unique username fo

How to pass arguments in command line using dotnet?

the command dotnet myapp.dll -- [4, 3, 2] throws the exception System.FormatException: Input string was not in a correct format. I do not know the syntax. How s

Upload byte array without actually creating a local file to SFTP server using WinSCP .NET assembly?

I need to write a PowerShell script that reads some data and writes it to a file on a remote SFTP location. I'd rather not generate a local file first before i

Updating Path multiple times in the same RUN command

Consider the following Dockerfile. On the last lines, first git is installed, and then something is appended to the path environment variable. FROM mcr.microsof

Invoke-Sqlcmd with AAD authentication

In an Azure DevOps 'release pipeline', I provision Azure resources - including SQLServer databases - and try to configure access to databases using managed iden

How to execute Set-GPPermissions command without confirmation prompt

Set-GPPermissions -Guid <Guid> -TargetName "Authenticated Users" -PermissionLevel None -TargetType Group -Replace -Confirm:$false Used to work fine, but

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