Questions Tagged [Powershell]
Ask Question Powershell Is a Cross-Platform Command Line and Scripting Utility from Microsoft. Use This Tag for Questions About Writing and Executing...
PowerShell is a cross-platform command line and scripting utility from Microsoft. Use this tag for questions about writing and executing PowerShell scripts ONLY. Programming questions specific to the cross-platform version PowerShell Core (Windows, macOS, and Linux) should be tagged [powershell-core]. Questions about system administration should be asked on Super User or Server Fault.
Must Read
103,982
questions
0
votes
1
answer
6
views
Passing Header Auth Bearer token as variable in Powershell Invoke-RestMethod
I have the below code, where i am trying to capture the access token and passing it as a variable in the Headers section for Bearer token, but looks like the $Token.access_token is not getting ...
0
votes
0
answers
13
views
What's the difference between using Set-Variable vs. $varName = in PowerShell? [duplicate]
What's the difference between defining a variable using these two ways:
Set-Variable test -Option Constant -Value 100
and
$test = 100
-2
votes
0
answers
18
views
how do i solve these on my laptop how to enable script running [duplicate]
enter image description here
sanity : File C:\Users\sulaimon abraham\AppData\Roaming\npm\sanity.ps1 cannot be loaded. The file C:\Users\sulaimon
abraham\AppData\Roaming\npm\sanity.ps1 is not digitally ...
-2
votes
0
answers
17
views
Can I use Python or PowerShell to get the names of all my Amazon Music Playlists? [closed]
I want to regularly extract a list of the names of my Amazon Music playlists (not the songs in them).
I've got beginner-middle skills in both Python and PowerShell, including Web API & JSON usage.
...
-1
votes
0
answers
17
views
I am looking for variable text in a file that follows "source=" and is before ";initial" [closed]
I have created and audit script that I can place on a server that has our software on it so as to automatically retrieve most of the information I need. The last piece is driving me crazy.
I’m looking ...
0
votes
0
answers
21
views
Screen sharing with powershell
i am trying to make a screen viewer.
i have an C# server side that works good and i have C# client side that works good.
this is my C# client side code:
using System;
using System.Collections....
2
votes
2
answers
65
views
What is the best way to check PowerShell Execution Policy in C#?
When you run Get-ExecutionPolicy in PowerShell, it gets the effective execution policy. I need to know the best way to get that information in C#. I don't need to know how to change it like many other ...
0
votes
1
answer
25
views
.net error - are you missing an assembly reference?
I've created .net program using dotnet new console -o MyApp -f net6.0 command just as documented in
I've modified the file:
...
1
vote
1
answer
23
views
Formatting .CSV in Powershell
So I'm writing a powershell script to help sort data I have, but I need that data in a certain format.
FN: ORG: Title Tel: Email:
Example A Exam A Exa A EX A ...
0
votes
2
answers
29
views
How would I disaply only the last two days of windows updates in powershell?
Okay, so I'm in the process of writing out a script, and I'm at a point where I want to count the number of updates installed in the last day or so. I'm using Get-CIMInstance because the get-wuhistory ...
0
votes
0
answers
8
views
Cannot remove .sonarqube folder on a Windows agent in a DevOps Server pipeline due to an invisible file
In our pipelines building .NET apps, we use SonarScanner for Azure DevOps version 4.23.1, using the MSBuild integration. Sometimes, the tasks leave some mess in the .sonarqube directory inside the ...
1
vote
1
answer
22
views
Activate virtual environment from a python script
I am trying to create a python script for automating some of my personal stuff.
In the script, I first want to activate my virtual environment and then do some other tasks,
(API calls and processing ...
0
votes
0
answers
10
views
Finding DOM elements with RelativeBy in Selenium 4 and Powershell
Riffing off of this question here: Finding elements with PowerShell and Selenium 4
It's pretty easy use Powershell with Selenium 4 to find elements on the page like this with By.Id:
$driver....
0
votes
2
answers
9
views
Powershell Curl alternative with Multiform data in Body getting 400 BAD request
I have a curl command that i translated in to powershell but i get Below error
ErrorMessage
The remote server returned an error: (400) Bad Request.
CanTimeout : True
ReadTimeout : -1
WriteTimeout ...
0
votes
1
answer
13
views
AD: How can I modify the nTSecurityDescriptor/DACL/ACL from DirectoryServices.Protocols.LdapConnection?
I have tried with ModifyRequest but unfortunately I was not able to find the proper way.
I see it is very straightforward to do with DirectoryEntry but I must use the raw LdapConnection since it is ...