powershell Questions
2
Solved
I'm trying to find a TOML file parser for PowerShell.
I can't find any information about it either in PowerShell Gallery or in the preinstalled PowerShell functions.
Coventry asked 24/4, 2022 at 20:41
4
Solved
PowerShell Timespans are great for quickly displaying durations, as in:
$starttime = $(get-date)
{ do some processing here }
write-host "Duration: $((new-timespan $starttime $(get-date)).tostring(...
Wolfhound asked 20/8, 2010 at 23:55
3
Solved
I'm looking to implement a PowerShell Provider in PowerShell.
I keep thinking that if I just define the types, then import them into my session (import-module), I should be able to have them avai...
Silurid asked 22/5, 2012 at 20:21
2
Solved
When I run a below command to list log by ID, it says Get-WinEvent : No events were found that match the specified selection criteria.
How can I catch this exception and display a simple message s...
Groenendael asked 31/10, 2014 at 17:12
1
What I want is a combo of a switch parameter and a string parameter.
Where there are 3 scenarios (not just 2):
-log not given
-log given, default filename
-log filename given
All these stat...
Heavenly asked 17/10 at 19:21
4
Solved
I have a drive with lots of directories and files, some of which are broken and have no file extension. I would like to delete all of the files that do NOT have an extension. I have tried gci | whe...
Journeywork asked 12/2, 2014 at 20:44
3
Solved
I'm using the Invoke-RestMethod to get the data from REST API. One of the attributes in response is the date. When using Postman or other tools to get the data the date is returned correctly but wh...
Calcify asked 11/10, 2021 at 14:5
2
Solved
Recently, after upgraded my Windows 10 to Windows 10 22h2 (build 19045), Visual Studio 2019 cannot start, because the 32 bit version of powershell.exe is failing:
"c:\windows\syswow64\windowsp...
Carnot asked 14/10 at 5:3
2
Solved
I am wondering if one of the powershell, C# gurus can please shed some light on the how to force Sslv3 during a webrequest on Windows using [System.Net.WebRequest]
I would like to convert the foll...
Vera asked 12/6, 2012 at 16:13
5
I recently finished a script to ping every computer/workstation on a list and output it in a nice format.
There are thousands of computers to ping on the next list so it would take a while to run...
Tirade asked 21/6, 2016 at 20:29
3
Solved
I am working with Azure Active Directory and want to know when a user's password expires.
Currently I use these PowerShell commands to connect to msol service successfully and get password expiry,...
Hammer asked 8/4, 2017 at 13:10
2
When destination folder exists the right way of copying files is defined here
Copy-Item 'C:\Source\*' 'C:\Destination' -Recurse -Force
If destination folder doesn't exist, some files in the sour...
Towboat asked 19/6, 2018 at 8:35
5
Solved
I suddenly started to recceive this warning when running any script on my computer:
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially ha...
Solitaire asked 26/7, 2016 at 8:11
1
Solved
I have a workflow that is pretty picky with the PSCustomObjects it receives. I often use Select-Object to get the properties from the objects I want to keep and sometimes I need to convert some of ...
Geode asked 21/9 at 11:8
3
Solved
I have this PowerShell script, that reads some environment variables and outputs them:
Write-Host "name: $(tenantName) version: $(versionRelease) url: $(urlApplication)"
Those variables are defi...
Seiler asked 16/6, 2020 at 13:0
2
I'm running a command (New-AzResourceGroupDeployment -WhatIf) in Powershell (or Powershell Core, both are options here), that produces some very colorful output like this:
The problem is that when...
Mannequin asked 15/1, 2021 at 11:53
3
How can I supress the detailed information from Test-NetConnection -ComputerName localhost for a PowerShell session?
Test-NetConnection writes quite a bit of information to the console which is di...
Bertberta asked 14/9, 2017 at 8:29
2
Good Afternoon,
I am trying to run this script remotely and I keep receiving the following error:
Register-ScheduledTask : No mapping between account names and security IDs was
done.
(42,4):UserI...
Hazelwood asked 11/10, 2019 at 17:51
7
We have some scripts that create scheduled jobs using PowerShell as part of our application. When testing them recently, I noticed that some of them always failed immediately, and no output is ever...
Lohner asked 17/1, 2013 at 12:18
6
Solved
I am trying to understand how to pipe | an object and call the properties or methods on that.
Ex:
$a = Get-Item Registry::HKLM\SOFTWARE\WOW6432Node\Microsoft\Test\abc\
$a.GetSomething() //calls th...
Czarevitch asked 19/8, 2016 at 8:19
2
Solved
I have the below script that I run, how can I get the output to be placed into a comma separated string?
Get-ADGroup -filter * -properties GroupCategory | ft objectguid, samaccountname
Current Out...
Chilson asked 11/5, 2016 at 18:44
8
Solved
I'm not getting the expected output when trying to sort the output from winget list in powershell. The Id column is not sorted.
# winget list | Sort-Object -Property Id
ScreenToGif NickeManarin.S...
Drawee asked 1/11, 2022 at 13:5
2
Solved
I want to list *.xml files which are in several subdirectories. Then I want to write their path and their names into an txt file.
I managed to write the names into an txt file, however, I have no i...
Thunderclap asked 16/1, 2014 at 13:40
6
I am trying to follow the simple example for embedding python within c++ using pybind11 as found on this page. However, when trying to use cmake to build the solution, I keep getting an error that ...
Flyblow asked 4/8, 2020 at 20:26
11
Solved
Hoping this won't be too difficult but I am writing a script that queries user information from the domain and exports to CSV.
The script is run by our administrative staff and all they need to in...
Variolite asked 28/5, 2013 at 6:29
1 Next >
© 2022 - 2024 — McMap. All rights reserved.