cmdlets

Azure service bus ACS issuer and key is missing

别等时光非礼了梦想. 提交于 2019-12-12 23:23:32
问题 I created some Service Buses today and besides having a specific type ("Messaging", my older buses are "Mixed") they don't give me any ACS information that I need. My old Service Buses do have this information. What I understand from this: Azure: How to createa a Access Control Service namespace for a Service Bus namespace? is that I might need to use Powershell Cmdlet which I have no knowledge of. Is there a way to add ACS to the Service Bus? And how? 回答1: Yes, you will need to use

How to find which Cmdlet Alias was used by user?

家住魔仙堡 提交于 2019-12-12 11:11:08
问题 Please excuse me if you find this a very lame questions, but since I am learning Powershell I need to ask. This is a sort of next part of the question posted and answer received here. I have a custom cmdlet named Get-DirectoryListing and I added an alias 'gdl' (using New-Alias command in .psm1 file). So user can use either Get-DirectoryListing or gdl to fire the same command. Now I want to detect in my code (.NET, C#) which text was used to execute the command. Lets say if user used alias

How do I change the timeout value for Add-Blob Azure cmdlet?

南笙酒味 提交于 2019-12-11 19:05:06
问题 I'm trying to invoke Add-Blob Azure cmdlet Add-Blob -BlobType Block -FilePath $packagePath -ContainerName $blobContainerName and it has been working just fine until recently but now it fails with Operation could not be completed within the specified time. message. I suspect that for whatever reason the upload speed has got really low and so it just doesn't manage to upload the file fast enough. Is it possible to increase the timeout value for that operation? 回答1: Are you using the Cmdlets

Fix ANSI control characters before PowerShell output to a file

孤人 提交于 2019-12-11 16:45:18
问题 Is there anyway for PowerShell to output a file without ANSI control characters like color control, e.x. [1;xxm or [xm] , before outputting to a file, [1;35mStarting selenium server... [0m[1;35mstarted - PID: [0m 22860 [0;36m[Signin Test] Test Suite[0m [0;35m================================[0m Running: [0;32mstep 1 - launch the browser[0m [1;35m[40mINFO[0m [1;36mRequest: POST /wd/hub/session[0m The output displays correctly with color in PowerShell terminal, (I've used chcp , not working) 回答1

How to display nested objects with .ps1xml file through c# cmdlet into powershell

不羁的心 提交于 2019-12-11 11:44:12
问题 hi i have heirarchial object structure like public class Department { public Guid ID {get; set;} public string Name{get; set;} } public class Employee { public Guid ID {get; set;} public string Name{get; set;} public Department Department {get;set;} } i have created a formatedoutput.ps1xml file to show the employee object in powershell <?xml version="1.0" encoding="utf-8" ?> <Configuration> <ViewDefinitions> <View> <Name>EmpView</Name> <ViewSelectedBy> <TypeName>Employee</TypeName> <

How to run startup code in a c# powershell module

大城市里の小女人 提交于 2019-12-11 06:55:17
问题 I have created a simple PowerShell module in c# which implements a few cmdlets and I would like to be able to run code when the module is imported. From looking around on google and in the namespace there doesn't appear to be a proper way of doing this. The work around I have come up with so far is to either create a psm1 or ps1 file that runs when the module is loaded and does the startup actions (would rather not use this as scripts are blocked on some environments this will run on). Other

Powershell help, if process exists, stop it, else start a service?

跟風遠走 提交于 2019-12-11 03:24:57
问题 I'm pretty new to Powershell. I have 2 different scripts I'm running that I would like to combine into one script. Script 1 has 1 line Stop-Process -ProcessName alcore.* -force It's purpose is to end any process that begines with "alcore." Script 2 has 1 line as well Start-Service -displayname crk* It starts any service that begins with crk. How can I combine these into one script? If the processes are running I wish to stop them, if not, I wish to start the services. How can I accomplish

How to use Exchange 2010 cmdlet in batch file

落爺英雄遲暮 提交于 2019-12-11 01:14:15
问题 I can run Get-ActiveSyncDeviceAccessRule correctly in Exchange Management Shell directly. (reference: http://technet.microsoft.com/en-us/library/dd776124.aspx) Then I wrote a batch file as below, but I got CommandNotFoundException . I'd like to know how I can use this cmdlet with cmd.exe? Could anyone can help me? Thank you. (Editor's note: The next three lines were wrapped for formatting. Originally 1 line) C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Get

Getting particular user details from AzureAD using Powershell cmdlets in C#

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 00:46:14
问题 I am able to import AzureAD module and able to connect AzureAD using Connect-AzureAD PowerShell cmdlet in C# . When I want to list the users I just simply use the Get-AzureADUser got all users. But When I want to list the particular user using Get-AzureADUser -SearchString 'user@domain.com' , I am not able to list. Tried one: Runspace runspace = RunspaceFactory.CreateRunspace(); runspace.Open(); Pipeline pipeline = runspace.CreatePipeline(); pipeline.Commands.AddScript("Import-Module AzureAD"

How to read multi line multi string registry entries in PowerShell?

为君一笑 提交于 2019-12-10 21:08:13
问题 I am trying to read the "-Dhttp.port" value with no luck. AS you can see in the attached image, "Options" is a sub-key and I am able to read "Options" using the following snippet (this shows unnecessary PowerShell items too though) Get-ItemProperty $PATH -Name "Options" Now from the multi-line "Options" I want to read the value of specific sub-key "-Dhttp.port" which is 80 here Output for Get-ItemProperty $PATH -Name "Options" is I want to read only "Options", and from Options key I want to