Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
58 views

I am working with a Powershell script, using DBATools, which exports data from multiple tables to individual CSV files. In the tables, I am needing to reformat the date to yyyy-mm-dd. I found the ...
buck1112's user avatar
  • 512
0 votes
1 answer
103 views

Is there a way to add a key-value pair to a JSON object in Powershell without using the ConvertFrom-Json cmdlet? The script I currently have outputs a JSON file that is unreadable because it has ...
mimi m's user avatar
  • 71
4 votes
1 answer
102 views

I have a compiled Cmdlet that works with Hashtables. I would like to write a [pscustomobject] of the hashtable to the pipeline. In a PowerShell script block that would be accomplished using the ...
alx9r's user avatar
  • 4,353
0 votes
2 answers
105 views

I try to run the following statements on an usb attached device : Clear-Disk 2 -RemoveData -RemoveOEM -Confirm:$False Set-Disk -Number 2 -PartitionStyle MBR When the device is a usb stick (flash disk)...
RPO's user avatar
  • 3
0 votes
0 answers
120 views

I am testing Row-Level Security (RLS) using the Power BI REST API but noticed that roles are not being applied. The query executes with full admin access instead of enforcing the assigned role. ...
zargawy's user avatar
  • 43
2 votes
0 answers
45 views

Is there a way to use reflection to programmatically inspect and determine if a given compiled cmdlet requires elevation? Notes: This question concerns compiled cmdlets, not script (text) files. ...
Paul π's user avatar
  • 585
2 votes
3 answers
127 views

Consider the following Invoke-Command { 'a'; Write-Verbose 'a' -Verbose 'b'; Write-Verbose 'b' -Verbose } | . { process { Write-Verbose "downstream_$_" -Verbose } } which outputs ...
alx9r's user avatar
  • 4,353
0 votes
1 answer
412 views

I'm trying to build a simple PowerShell cmdlet that will use iText7 to open a PDF file and output the text. I've tried using the iText7Module from PowerShell Gallery, but the ...
evandrunen's user avatar
1 vote
0 answers
119 views

I am currently developing a REST API that needs to interact with an on-premises Microsoft Exchange server (Exchange 2007, not Office 365) through PowerShell commands. In my development environment (...
Juan Luis Martos's user avatar
0 votes
1 answer
218 views

I'm currently working on Exchange license storage usage analysis and encountered a discrepancy between the storage usage size shown in the Exchange Admin Center (EAC) for each user and the size ...
CodeSeeker's user avatar
0 votes
0 answers
442 views

I have Powershell script which I use to remove MFA authentication methods of a user through MS-Graph. At a certain point the code executes this command: try { Remove-...
user avatar
2 votes
1 answer
79 views

I have created a PowerShell cmdlet in C#: using System.Management.Automation; using thosepeskyexternalclasses [Cmdlet(VerbsCommon.Get, "GetActivity", SupportsTransactions = false)] public ...
William Holmes's user avatar
1 vote
0 answers
1k views

I’m having trouble with PowerShell and Microsoft Exchange. I’m trying to interact with Exchange Online via PowerShell to retrieve all emails received within a specified date range and display them on ...
Daniele's user avatar
  • 13
0 votes
1 answer
89 views

Why is the ng command not working ? The command should work but it's giving me an error like: The term 'ng' is not recognized as the name of a cmdlet, function, script file, or operable program. ...
Sakshi Dubey's user avatar
-5 votes
1 answer
197 views

I want to compile cpp project in vscode and I write "make to terminal after that I have a error :enter image description here What do you think about this error .How I solve this? I can't ...
bilaltan's user avatar
0 votes
1 answer
146 views

I have a command Get-Aduser -Filter 'Surname -like "Doe"' -properties * | Format-List, but I'd like to use it with a Read-Host cmdlet using inline syntax. Something similar to Get-Aduser -...
Dima Hmel's user avatar
  • 237
1 vote
1 answer
342 views

I am trying to extract a representative sample of a 200MB csv file by writing the header and every 500th row to a new file for testers to use. My first attempt was knowingly sub-optimal but seemed ...
Autumnal Sigh's user avatar
0 votes
1 answer
64 views

Can anyone please help me understand why "Remove-Item" cmdlet behaves weirdly when using -Filter option for removing specific list of files? Same if I passed in other cmdlets its working ...
kyeleswarapu's user avatar
0 votes
1 answer
39 views

I'm developing PowerShell Cmdlets in C#. I would like to define mandatory parameters, but that are mutually exclusive. Example: Parameter A Parameter B When invoking the command, I must set only ...
vittochan's user avatar
  • 685
0 votes
1 answer
168 views

Earlier when I used to use command $DebugPreference="Continue" within the powershell script, this used to print the output with all the debugging lines. Now I am not able to see debug ...
Srishti garg's user avatar
0 votes
1 answer
708 views

I am trying to execute a powershell script in azure automation account runbook test pane. In my powershell script, I am importing the modules, connecting automation account using managed identity and ...
Srishti garg's user avatar
0 votes
0 answers
1k views

We use powerscript with EXO on many tenants where we have created an App in the Azure portal. This app has Office 365 Exchange Online application permissions: full_access_as_app Exchange.ManageAsApp ...
Michiel's user avatar
  • 77
0 votes
2 answers
191 views

Edited with last version code: I have a PowerShell script which is doing following steps: Connect to SQL server, download table of 3 variables (three fields) Then Connect to REST API (based on three ...
MilkyMan's user avatar
1 vote
1 answer
135 views

I'm currently learning Powershell 101 using PowerShell 7.4, and I'm interested in inpecting the type of some expressions, for example by executing [Powershell] | gm I get: TypeName: System....
SaturnTsen's user avatar
0 votes
0 answers
33 views

Set-Service -Name TeamViewer -DisplayName Team Viewer And I always get this error,even if I add double quotes on the name and the displayname Set-Service: A positional parameter cannot be found that ...
Marwan Takchi's user avatar
0 votes
1 answer
1k views

I'm trying an experiment and I want to create a CmdLet for PowerShell in NET8. I have created a new Class Library and added the following packages: Microsoft.PowerShell.SDK PowerShellStandard.Library ...
Enrico's user avatar
  • 6,872
0 votes
1 answer
104 views

Experienced with PowerShell, but new to C#. I am creating a Binary PowerShell Cmdlet and have run into an issue when trying to serialize PSCredential to XML with the XmlSerializer. When I serialize ...
Qrm's user avatar
  • 13
-1 votes
1 answer
135 views

I have written functions that have path parameters. I'm not sure if I implemented it correctly. Is there a standardized or better way of doing this in Powershell? function Get-PathExample { param( ...
someone's user avatar
0 votes
0 answers
52 views

I wrote a PowerShell function in F# and I would like to run NUnit tests on the functions. In C# I wrote these tests previously: [Fact] public void ConvertJWTTest() { //-- Arrange var base64 = &...
Alex_P's user avatar
  • 3,032
-1 votes
1 answer
74 views

I hope there must be powershell cmdlet to open the Windows host entry file. I have checked across the net and I could to find the windows command for opening the host entry file, so I can utilize it ...
Dev Anand Sadasivam's user avatar
0 votes
1 answer
322 views

I'm attempting to dynamically create about 50 QR Codes using GoQR.me's API. I have all the source and destination URLs in a CSV file QRCodes.csv formatted as: source, destination https://api.qrservers....
dpruth's user avatar
  • 326
1 vote
0 answers
269 views

I am getting "PrincipalSource" property Blank while running following command by PowerShell Script in c#. Command : Get-LocalGroupMember -Group Administrators PowerShell Output: By C# Code ...
Mr. Pramod Kumar's user avatar
1 vote
1 answer
1k views

I'm facing an issue while trying to set an alias using PowerShell (oh-my-posh) on Windows 11. I have successfully created aliases before, like opening Notepad++ using Set-Alias np path_to_notepad_exe. ...
Abdullah Alhabal's user avatar
1 vote
1 answer
1k views

Update: My use-case requires me to automate deployment of Windows Server VMs for test environment. While I've managed to find ways to automate the process via powershell in 90% of tasks, I'm now stuck ...
renice's user avatar
  • 33
1 vote
2 answers
2k views

I know about Write-Progress cmdlet and use it. This cmdlet is usefull where you want to show progress of an loop running for example, or when stack of cmdlets is running. But how can I show progress ...
Posix's user avatar
  • 23
0 votes
1 answer
500 views

Whenever I try to run said function, I keep getting this particular exception: EXCEPTION: Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=...
keimpe's user avatar
  • 1
0 votes
0 answers
47 views

powershell running a c++ .exe using start-job cmdlet $connectionstring = "Server=localhost;Database=testDB;Trusted_Connection=True;" $connection=New-Object System.Data.SqlClient....
Tigi Casper's user avatar
0 votes
1 answer
308 views

In this code of block everything works great, but... when you type list it supposed to show the entire list of available servers connected, but the servers with id 02, 03, 04, 09 are not revealing, ...
Euclid-bytes's user avatar
2 votes
1 answer
588 views

I've been reading up on generating error messages in PowerShell and stumbled across this example... $Exception = [Exception]::new("error message") $ErrorRecord = [System.Management....
Dennis's user avatar
  • 2,128
1 vote
1 answer
609 views

I'm trying to create a task on windows taskscreduler using the powershell but without success. The script I need to create based GUI description: "At 08:00 every day -After triggered, repeat ...
Patrick Geovani's user avatar
0 votes
1 answer
185 views

I am trying to obtain the MachineGuid through NodeJS using child_process.exec with cmdlet Get-ItemPropertyValue const command = "Get-ItemPropertyValue -Path 'HKLM:\\Software\\Microsoft\\...
Daniel's user avatar
  • 1
0 votes
1 answer
181 views

I have a Match[] from string matching, each Match has a Groups property which is a GroupCollection. I want to map the Match[] to a GroupCollection[], and I'm trying to do this with a pipeline's output ...
Brother58697's user avatar
  • 3,208
1 vote
1 answer
84 views

I want to write a cmdlet that changes its behavior depending on its pipeline position. Simplyfied example: Get-XYZObject | Rename-XYZObject If the cmdlet is the last in the pipeline it should work ...
Tobias Wollgam's user avatar
0 votes
1 answer
199 views

I try to run a Script that will give mal participants of a mail-distributiongroup and their mailaddresses. For the participants it works quite well, while for the owners it doesent work, because im ...
MirrahOH's user avatar
0 votes
1 answer
940 views

Microsoft has introduced a powerful cmdlet called Invoke-AzCostManagementQuery, which is part of the Az.CostManagement module. This makes it possible to generate customized cost reports in all ...
Gill-Bates's user avatar
0 votes
1 answer
193 views

The file load error keeps popping up after I added contents to the file by using commands. I was working on Windows PowerShell on JupyterLab. Firstly, I created a new file using the following command: ...
Chau's user avatar
  • 1
0 votes
1 answer
232 views

I'm trying to automate some processes with Powershell and browsing here and there a bit, I've put together a little .ps1 file that allows me to mount an Iso image on the next available drive, store ...
kea_da's user avatar
  • 3
0 votes
0 answers
3k views

Unable to execute powershell script from the command prompt. test.ps1 file: echo "testing" Here is the error: c:\run>powershell .\test.ps1 echo : The term 'Write-Output' is not ...
suthan's user avatar
  • 1
0 votes
0 answers
17 views

I am collecting a list of names and paths from the following PowerShell code: (new-object -com shell.application).namespace('shell:appsFolder').items() I am able open each item using its invokeVerb() ...
J Dev's user avatar
  • 1
-1 votes
1 answer
327 views

I am using Transferetto module to download SFTP files, it is able to connect to server and list the server files but throwing error while downloading with below error:- Receive-SFTPFile : A parameter ...
John's user avatar
  • 105

1
2 3 4 5
18