powershell

Azure Logic App with SharePoint Connection

两盒软妹~` 提交于 2020-12-13 03:05:34
问题 I am creating my first logic app which connects to SharePoint and adds entries into some sharepoint list. Whenever I create a SharePoint Connection it adds below resource to my logic app. { "type": "MICROSOFT.WEB/CONNECTIONS", "apiVersion": "2018-07-01-preview", "name": "[parameters('sharepointonline_1_Connection_Name')]", "location": "[parameters('logicAppLocation')]", "properties": { "api": { "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters(

Azure Logic App with SharePoint Connection

自古美人都是妖i 提交于 2020-12-13 03:05:20
问题 I am creating my first logic app which connects to SharePoint and adds entries into some sharepoint list. Whenever I create a SharePoint Connection it adds below resource to my logic app. { "type": "MICROSOFT.WEB/CONNECTIONS", "apiVersion": "2018-07-01-preview", "name": "[parameters('sharepointonline_1_Connection_Name')]", "location": "[parameters('logicAppLocation')]", "properties": { "api": { "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters(

Exchange Server 2010升级到Exchange Server 2016

旧巷老猫 提交于 2020-12-12 22:46:22
Hello各位小伙伴们,失踪人口回归啦~~~这次和大家分享Exchange Server 2010升级到Exchange Server 2016的方法。正式开始前先啰嗦几句,为什么我要写这篇文章呢?一方面有客户有exchange 服务器升级的需求,另一方面,如果客户使用的21V世纪互联运营的Office 365并且邮箱要做混合部署的话,也需要把本地已有的Exchange服务器升级到2013版本或者以上。考虑到这两个方面,我打算为大家分享本地Exchange服务器升级的方法。 准备环境 服务器 Exchange Server 2010 Exchange Server 2016 域控服务器DC 在进行升级之前,我们需要对目前已有的环境作相应的配置。我们需要配置默认脱机通讯簿, 创建用于将 Exchange 2010 升级到 Exchange 2016 的管理员帐户。 在域控服务器上,以管理员的身份运行Powershell,依次运行以下命令行来重置授权状态: Restart-Service CertSvc slmgr -rearm slmgr EX2010 -rearm slmgr EX2016 -rearm 切换到 Exchange 2010 ,以Exchange管理员的身份登录,打开Exchange Management Shell,依次运行以下的命令行: Get

Rewrite CURL in PowerShell using Invoke-WebRequest with multiple certificates

和自甴很熟 提交于 2020-12-12 10:22:07
问题 I use the following curl command to publish some data from an IoT Thing to AWS's IoT Core service. curl.exe --tlsv1.2 --cacert root-CA.pem --cert certificate.pem --key private.pem -X POST -d "$($Body)" "https://ats.iot.eu-west-1.amazonaws.com:8443/topics/example/1" The command works perfectly, but I would like to leverage the features of the Invoke-WebRequest commandlet. Unfortunately I cannot figure out how to rewrite the curl command, primarily because of the two certificates and key file.

PowerShell 处理对象

冷暖自知 提交于 2020-12-12 09:57:45
来自《Windows Powershell入门指南》 处理对象   虽然您最初可能没有意识到,但是在 Windows PowerShell 中工作时,所使用的是 .NET 对象 。随着您经验的增加,对象处理能力变得更明显,而且您发现自己使用的是对象,甚至用对象进行思考。      从技术上讲, .NET 对象是 .NET 类的实例,包含数据以及与该数据关联的操作 。但是,可以将对象视为具有 属性(与特性类似) 和 方法(可以对对象执行的操作) 的数据实体。      例如,在 Windows PowerShell中获取服务时,实际上是获取表示该服务的对象。查看有关服务的信息时,所查看的是其服务对象的属性。此外,启动服务时(即,在将服务的 Status 属性更改为“started”时),所使用的是服务对象的方法。      类型相同的所有对象都具有相同的属性和方法,但是对象的每个实例可能具有不同的属性值。例如,每个服务对象都具有 Name 和 Status 属性。但是,每个服务都可以具有不同的名称和不同的状态。      准备就绪后,了解对象是很容易的。若要查明 cmdlet 正获取对象的类型,请使用管道运算符 (|) 将“get”命令的结果发送到 Get-Member 命令。例如,以下命令将 Get-Service 命令检索的对象发送到 Get-Member。 Get

Hex to Decimal Conversion - PowerShell 5

爱⌒轻易说出口 提交于 2020-12-12 07:43:27
问题 For some reason, when converting some values in PowerShell from Hex to Decimal, I get incorrect value. For example: - Type 0xC0000000 then hit enter, you'll get -1073741824 which is incorrect, the right value is 3221225472 . The answer given is the value for the negative Hex number I entered FFFFFFFFC0000000 I thought this could be an interpretation issue so I explicitly asked to convert the value to from Hex to Base10 (Decimal), I still got the same incorrect answer -1073741824 : [Convert]:

.NET types in PowerShell classes

≡放荡痞女 提交于 2020-12-12 06:22:26
问题 I am trying to get my head around PowerShell Class best practices, and running into some confusion with a simple class to handle Balloon Tips. Add-Type -assemblyName:System.Drawing Add-Type -assemblyName:System.Windows.Forms class PxMessage { static [PxMessage] $instance static $balloon static $defaultIcon static [PxMessage] GetInstance($processIcon) { if ([PxMessage]::instance -eq $null) { [PxMessage]::instance = [PxMessage]::new() #[PxMessage]::balloon = [Windows.Forms.NotifyIcon]::new()

How can I catch an Excel file's macro error in Powershell?

懵懂的女人 提交于 2020-12-12 04:40:50
问题 I have a scheduled PowerShell script that opens Excel, opens a file and runs a macro. If an error arises, I need to display it in the shell and interrupt the script. (I can not afford the script to hang while waiting for user input) Here is my current script ($excelDataPath is defined earlier in the script) $Excel = New-Object -ComObject "Excel.Application" $Excel.DisplayAlerts = $false $Excel.AskToUpdateLinks = $false $Excel.Visible = $true $Workbook = $Excel.Workbooks.Open($excelDataPath)

How to add version info to my powershell script?

大憨熊 提交于 2020-12-12 01:49:29
问题 I have a script, test.ps1 , shown below. But I would like to be able to run: .\test.ps1 -version and have it return the current version of the script to me. Is there a way to do this? <# .SYNOPSIS Test .DESCRIPTION Desc .INPUTS None .OUTPUTS None .NOTES Author : me Version : 1.0 Purpose : PowerShell script test #> This did not work. 回答1: I would like to be able to run a .\test.ps1 -version and have it return the current version of the script to me. Is there a way to do this? You can achieve

How to add version info to my powershell script?

蓝咒 提交于 2020-12-12 01:49:13
问题 I have a script, test.ps1 , shown below. But I would like to be able to run: .\test.ps1 -version and have it return the current version of the script to me. Is there a way to do this? <# .SYNOPSIS Test .DESCRIPTION Desc .INPUTS None .OUTPUTS None .NOTES Author : me Version : 1.0 Purpose : PowerShell script test #> This did not work. 回答1: I would like to be able to run a .\test.ps1 -version and have it return the current version of the script to me. Is there a way to do this? You can achieve