Questions tagged [powershell-cmdlet]

Quote from Microsoft site: "A cmdlet is a lightweight command that is used in the PowerShell environment. The PowerShell runtime invokes these cmdlets within the context of automation scripts that are provided at the command line. The PowerShell runtime also invokes them programmatically through PowerShell APIs"

Ref: Cmdlet Overview

882 questions
0
votes
2 answers

PowerShell start-sleep cmdlet

Hey I am very new to PowerShell and found one of Ed Wilson's helpful scripts on his blog: http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx. I needed to customize it a…
Grass Ark
  • 1
  • 1
  • 3
0
votes
1 answer

Writing custom Powershell Cmdlet to accept table of data

I need to write a custom powershell cmdlet in C# that would accept data and be able to enumerate over it. I have followed some examples online and have some working code. The problem I have can be demonstrated as follows: I want a custom powershell…
Paul Davey
  • 87
  • 1
  • 8
0
votes
1 answer

Powershell searching multiple domains

I am trying to locate the XP computer accounts broken down by Business. We have several different business' housed across several domains. I have a collection of different txt files (BusinessX.txt), one for each business that lists the locations…
Decorius
  • 23
  • 1
  • 2
  • 5
0
votes
1 answer

Azure Powershell fails with vague error: One or more errors occurred

I am trying to download a Azure vhd to local disk. The process starts, creates the file, reports progress then exits with the below message. Save-AzureVhd -Source $sourceVHD -LocalFilePath $destinationVHD -NumberOfThreads 5 -verbose Elapsed time for…
reticentKoala
  • 235
  • 2
  • 9
0
votes
1 answer

Powershell variable passing inline

get-content C:\OUlist.txt | get-qadcomputer -SearchRoot $_ -DontUseDefaultIncludedProperties -IncludedProperties info In the OUlist.txt file there is a list of OUs. I am having trouble passing each of the OUs to the get-qadcomputer command. If I…
Decorius
  • 23
  • 1
  • 2
  • 5
0
votes
2 answers

Logging a Get-Item on Powershell

I wanted to know if there's an easy way to log all successful transferred items to a .txt file. I would like to create the .txt file and list all the files that are being transferred and updating it afterwards if it is used again (like on robocopy /…
0
votes
1 answer

Printing the whole line Powershell on word finder

$check = $args[1] $numArgs = $($args.count) $totMatch = 0 #reset variables for counting for ( $i = 2; $i -lt $numArgs; $i++ ) { $file = $args[$i] if ( Test-Path $file ) { #echo "The input file was named $file" $match =…
user2569803
  • 637
  • 6
  • 11
  • 19
0
votes
1 answer

Getting name of all the exchange server within an organisation?

I have using the exchange server 2013 , there are six exchange server in the organization. I wants to display the name of all the six exchange server in the organization using exchange management shell (cmdlets) . I am using get-exchangeServer…
0
votes
1 answer

Calling powershell cmdlets in powershell script

How do i use powershell cmdlets in a ps script?? I need to use Get-MailboxStatistics cmdlet to retrieve mailbox statistics from Exchange server 2013 using a ps script how can i invoke the cmdlet?
0
votes
4 answers

Deploying web role in Azure throws exception on CurrentAccountStorageName

I want to deploy a web role to Azure using the PowerShell CmdLets. My script is as follows: $subscription = "" $service = "" $slot = "staging" $package = "path\to\package.cspkg" $configuration =…
Kenneth
  • 28,294
  • 6
  • 61
  • 84
0
votes
2 answers

How to log output to file

powershell newb here. I am having some difficulty trying log my output to a file. I have tried two tactics, both of which do not work for me. The first is using the Start/Stop-Transcript cmdlet. This works great in testing on my local machine, but…
sqone2
  • 31
  • 1
  • 1
  • 5
0
votes
1 answer

Powershell cmdlet removing whitespace

I've created a small cmdlet in for Powershell to be able to send an e-mail using exchange services. When I pass the body of the message in Powershell seems to be stripping all whitespace out of the string. Here is the cmdlet…
Jeff Hornby
  • 12,948
  • 4
  • 40
  • 61
0
votes
2 answers

How many status of azure deployment could be

All, I am trying to deploy my cloud service to Windows Azure. Currently It works fine. But I still try to understand the detail inside of it . Like below Power Shell script. The script is trying to get the status of a deplpoyment in the Staging slot…
Joe.wang
  • 11,537
  • 25
  • 103
  • 180
0
votes
1 answer

Powershell Get-Process cmdlet inside Job

I have a problem with the Get-Process command in Powershell, when i use it inside a Job. I would like to get a process by PID, so i am doing the below: $MyProcess = Get-Process | Where-Object { $_.Id -eq $parentProcessID } The above, when it is…
nikkatsa
  • 1,751
  • 4
  • 26
  • 43
0
votes
0 answers

How to run my custom cmdlet with elevated privilege?

I'm a beginner to powershell. I have a custom cmdlet I created. This code will break at the last line: RunspaceConfiguration runspaceConfiguration = RunspaceConfiguration.Create(); PSSnapInException psEx =…
user1019042
  • 2,428
  • 9
  • 43
  • 85