119,247 questions
0
votes
0
answers
22
views
Azure Devops - Unable to connect with connect-mggraph
I have a pipeline with a task powershell to use easypim cmdlet to create a pim policy on new azure group:
- task: PowerShell@2
displayName: 'Configura PIM per GRUPPO ENTRA ID'
inputs:
...
2
votes
1
answer
95
views
"There is no such object on the server" when connecting to "CN=Deleted Objects"
I am using the DirectoryEntry class to connect to an LDAP entry point, so I can issue LDAP queries. I can specify any distinguished name I want, however whenever the Deleted Objects container is ...
0
votes
0
answers
57
views
Problem with powershell script for open Microsoft Edge [closed]
I'm opening Microsoft Edge through a script deployed using GPO on domain computers, but the browser can't access the microphone and camera. I solved this problem by adding the parameter ...
0
votes
1
answer
77
views
Create Proper MessageBox with only installed Software from the list
I have an addon what can be installed only to one Soft.
Lets say I already build simple list of Software with this addon can work on by reg query or test-path check:
If ((reg query "Soft1") -...
-1
votes
0
answers
92
views
Python encoding in windows
I am using powershell mcp.
I can't get the output of python subprocesses when I am doing it. It basically runs powershell with node-powershell package and return the output.
I was able to resolve it, ...
0
votes
0
answers
100
views
Can't pipeline array with one element [closed]
I have some code whose output is not entirely clear to me:
$session=New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri exchange.domain.local/Powershell -Authentication kerberos
Import-...
1
vote
0
answers
63
views
Powershell script using Microsoft.Graph in Task Scheduler - prompt for login every time its executed
I'm trying to run a ps1 script using Task Scheduler. The script uses Connect-MgGraph from Microsoft Graph PowerShell SDK and the Azure app has delegated permissions. While testing the script manually,...
1
vote
0
answers
90
views
Powershell Com Object Issues
I have a simple script to make file transfers between a local directory and an MTP device. For the MTP device, I created a ComObject and traversed to the desired directory. Then, I use the CopyHere ...
-1
votes
0
answers
91
views
How to redirect data generated from a powershell process that executes a tcl script and relay the processes log data back to the screen? [closed]
So, I have done some research and the best I can come up with - since the PowerShell command is launched from a Windows batch script by clicking on the file abc.cmd in Windows File Explorer.
Inside a ...
0
votes
1
answer
76
views
Problem with running a different PowerShell code (.ps1) from different folder one after the other
Please forgive me if this is a relatively simple fix, I am new to PowerShell scripting and could not find any answer that would work for my case.
What I am trying to do:
I have a "Main PowerShell ...
1
vote
1
answer
48
views
Call function by reference in PowerShell [duplicate]
Suppose I have a function like this. How can I get a reference to that function and then call it?
function Hello($name) {
Write-Output "Hello, $name"
}
-2
votes
0
answers
94
views
C#, PowerShell: return types [duplicate]
My requirement: Make the results from PowerShell commands in my C# code; I host PowerShell directly in C#.
I want to use the output of any PowerShell command or script in my C# code.
Some PowerShell ...
3
votes
1
answer
110
views
Powershell captures array function result with single element as just the element
I'm working on some code that still needs Powershell 5, and I'm making use of some .NET tools, including [System.BitConverter]::GetBytes(). This function always returns a byte array... it has to, as ....
5
votes
2
answers
84
views
unable to remove leftover "()" string with get-childItem in windows powershell
I restored a large number of files in diverse folders from a hard drive, and they all included a string.
I removed this string in windows powershell using
get-childItem -recurse | Where {$_.name -like ...
1
vote
1
answer
73
views
How to retrieve a specific variable from Azure Devops library dynamically
I have a simple yaml pipeline that calls a template analyze-and-deploy.yml.
I concatenate ${{ parameters.Environment }}_USERNAME to create a username parameter dynamically and pass it when calling ...