4,434 questions
1
vote
0
answers
59
views
How to make sure that folder or file has been removed successfully from path before moving to next line in powershell? [duplicate]
I have prepared powershell script to remove files or folders from target path. Script is removing files or folders from target path but I noticed that if folder size is large (around 700-800 mb or ...
1
vote
1
answer
104
views
Type of operator in powershell
i read analyse of code and i can't determine what type of operator and how it works, it's powershell, can you help me please.
I can't understand what is the operator and how it works :
${xadeoc} [ +52 ...
0
votes
1
answer
153
views
How to exclude folders from a recursive list of path\name with Get-ChildItem in Powershell 2.0 (similar to dir /s /b /a-d in DOS)?
I need to list recursively all files with paths, but without the lines for folders, something like this:
dir-name1\file-name1.ext
dir-name1\file-name2.ext
dir-name2\file-name3.ext
dir-name2\file-name4....
0
votes
1
answer
164
views
The object specified does not belong to a list - SharePoint Online PowerShell script
I am trying to get one of the properties (Batch date) of the SharePoint online document library file. I am getting below error Any suggestion on this please.
Batch date is single line of text field ...
1
vote
3
answers
85
views
How to add single quotes to one of the columns in PowerShell?
I have the following lines in a file:
pc_cc_text$fx_review1 CONSTANT VARCHAR2(100) := 'For Company Review'; -- AD_PRT_AUTH_(MSP)
pc_cc_text$fx_review2 CONSTANT VARCHAR2(100) := 'For Dept Review'; -- ...
0
votes
2
answers
274
views
Performance Counter Report w/ Powershell and Cooked Values
I'm trying to capture available size, remaining size, and a number of logical disk counters for my D:\ drive. however the following are the results I get
"Used Space" and "Free ...
0
votes
1
answer
166
views
How to run multiple commands at once with pause in PowerShell?
I want to run multiple commands at once with pause and but I'm not sure how. Here's my current code:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
ipconfig /registerdns
ipconfig /flushdns
...
0
votes
2
answers
111
views
How can I read and use the value of pipeline environment variable into my PowerShell and use that value subsequently on my URL of API Call?
I have created an pipeline variable on my release pipeline and I am able to read that value in my powershell script as well, the problem is that the value of that variable is not being populated/...
1
vote
2
answers
445
views
Add-AzTableRow throws error MethodInvocationException : The specified resource does not exist
We are encountering an error when attempting to add a new row to an Azure Storage Table using the -UseConnectedAccount context rather than a key based authentication in PowerShell.
Error Message is:
...
1
vote
1
answer
4k
views
Need to install Microsoft Visual C++ 2015-2022 via Powershell
I have to install the below Visual C++ software via powershell.
VC_redist_2015-2022x64
VC_redist_2015-2022x86
I have to first check whether the Visual C++ x64 & x86 installed on my server. If ...
-1
votes
2
answers
1k
views
how to get all lists in a ShrePoint site using SharePoint Online Management Shell cmdlets
when I was working with SharePoint Online using PowerShell, I had a requirement to get all the List collection present in my SharePoint site.
I got all the lists using PnP PowerShell commands. But i ...
0
votes
0
answers
118
views
Issue with my powershell script aimed to kick off a jenkins job
$UserName = "user"
$Password = "password"
$API_URL = "https://jenkinsservername"
$JobName = "firstjob"
$JobToken = "generatedtoken"
$header = @{}
$...
2
votes
2
answers
844
views
how to delete SharePoint Group connected sites using PowerShell?
In SharePoint, I need to delete a SharePoint group connected sites through PowerShell, but i was facing an error
This site belongs to a Microsoft 365 group. To delete the site, you must delete the ...
-1
votes
2
answers
493
views
PowerShell script to export Array in CSV format with Headers
I've below PS Script which connects to API and puts responses on an Array List.
I'm struggling to convert Array List to CSV file and giving them a Column Header.
Anyone got Idea how to this can be ...
0
votes
1
answer
56
views
Fetch all the files in a folder but exclude all the files in a sub folder by using powershell
I have a powershell script to fetch all the files in a folder but exclude all the files in a sub folder. I am using the following script, but not giving the expected results.
Get-ChildItem -Path $...
1
vote
1
answer
352
views
Passing admin credentials in Start-Process cmdlet
I am trying to build a script that installs an application with encrypted local admin credentials on the pc when the user logged in is not an admin.
I am running the below cmdlet:
$User = "admin@...
0
votes
1
answer
187
views
Add https://outlook.office.com/Exchange.ManageApp API permission to enterprise app
I am trying to register for Enterprise App from Web Application via MSAL. When I tried to add "https://outlook.office.com/Exchange.Manage" Scope it throwing error
asked for scope 'Exchange....
0
votes
1
answer
74
views
How to hide redundant argument values appear in the console, when using Powershell @2?
I have a pipeline which is running a series of Powershell@2 task.
Since last Friday, I started to see the output different from before. Please check the current output below:
enter image description ...
0
votes
1
answer
1k
views
After running a custom PowerShell script in Power Automate Desktop, how do I capture the output into a new variable?
I’m using Power Automate Desktop and running a custom PowerShell script using the "Run PowerShell Script" action.
Here is the PowerShell script I’m using:
# Get the 1st day of the current ...
1
vote
1
answer
747
views
Foregroundcolor is not being set correctly inside ScriptBlock
Edit: The issue I'm facing is from an ADO pipeline
I have a ps1 script that does parallel execution. I want to set the foreground color to green but the code is not working when I am setting it inside ...
0
votes
1
answer
57
views
I am encountering an error while attempting to retrieve domain policies and organizational units (OUs) within the domain
I am encountering an error while attempting to retrieve domain policies and organizational units (OUs) within the domain.
script:
Import-Module GroupPolicy
$forest = [System.DirectoryServices....
0
votes
0
answers
27
views
Applying SameDefinition for SameType on PS
can I shorten the following definitions as much as possible?
function Get-Info {
[CmdletBinding()] Param(
[Parameter(Position = 0, Mandatory = $True)][String]$A,
[Parameter(...
0
votes
1
answer
132
views
There is an PowerShell script, I just want the output should be stored in the CSV format
I have one powershell script, this script is supposed to execute on Domain controller. The script which is executed from Domain Controller server will fetch all the member server details and will ...
0
votes
0
answers
80
views
Azure VM Restore in Parallel
When I try to run Parallel VM restore in PowerShell. I receive the following error message. We have functions for restoring VM, but the Parallel one does not work. Could someone please assist me with ...
0
votes
1
answer
106
views
get text inside a section and remove the empty section in PowerShell
I have a file with below content
parallel (
{
some content 1
some content 2
build ( 'Job3', parameter5: value5)
some content 3
some content 4
}
)
...