I know what you’re thinking. “Why use Visual Studio Code instead of the PowerShell ISE?” Well, if you’re using Mac OS or Linux, you don’t have the option to use the PowerShell ISE natively. And that’s a problem if you want to take advantage of the cross-platform capabilities of PowerShell Core. In this article, I’ll show you how to use Visual Studio Code (free!) to perform the key functions of the PowerShell ISE, namely:
Recently I needed a way to copy a certificate file from within a PowerShell session to another Windows machine without opening a nested PowerShell session. But I ran into a little snag along the way: Copy-Item‘s dreaded Access is denied error. Here’s my setup: A Windows 10 laptop, from which I’m remoting NC1, a Server 2016 virtual machine I’m remoted into. It’s a member of a domain. HYPERV1, the Server 2016 machine I want to copy a certificate file to.
Sometimes you just need to create a file share. With Windows Server Core, you don’t have all the old GUI tools that we’re all used to. So you have to make do with PowerShell and the old fake DOS prompt. Fortunately, with a little help, it’s pretty easy. First, create the folder you want to share. In this case, c:\share Next, modify the ACL to grant the DOMAIN\File Server Admins group full control
In many Citrix environments it’s common to have a large variety of ICA client versions. One thing that sometimes surprises users and IT folks alike is how much of a performance increase can be seen after upgrading an old ICA client. But how do you know which clients need upgrading? One of the biggest challenges has been deciphering what ICA client version the cryptic “client build number” in a user’s session information translates to.
Sometimes there is a need to publish an application to individual XenApp servers for baselining or troubleshooting purposes. But if you have a lot of published applications in your XenApp 6 farm, this can be a huge hassle. Thankfully PowerShell allows us to quickly and easily take our existing published applications and automatically create individually published apps for each server. We can use Worker Groups to control which servers get an individually published application.
_Prerequisite: XenApp6 PowerShell SDK_ Let’s say you want to copy all currently published applications into a folder named “Test” in the console tree, while simultaneously modifying the new published apps with different permissions and client folder settings. Here’s how: First, create the “Test” folder by hand (you can use New-XAFolder -FolderPath Applications\Test if you are so inclined), then use the following command to copy the applications into it: get-XAApplication | Copy-XAApplication -folderpath Applications\Test Second, modify the published application properties to set the client folder (what folder the applications show up under in Program Neighborhood or Web Interface), and the permissions in one fell swoop.
I ran into a little snag when executing some XenApp PowerShell commands. Certain commands like Get-XAFarm and Get-XAAdministrator would always give an “0x80060016” error. Here is an example and the fix: PS C:\Windows\system32> Get-XAFarm<br /> Get-XAFarm : Error reading the current administrator data (0x80060016)<br /> At line:1 char:11<br /> + Get-XAFarm <<<<<br /> + CategoryInfo : InvalidResult: (:) [Get-XAFarm], CitrixException<br /> + FullyQualifiedErrorId : GetCitrixAdminType,Citrix.XenApp.Commands.GetFarmCmdlet Typically this error code in Citrix indicates a problem with IMA.