Tags » PowerShell

Today With PowerShell - Saturday 22nd October 2016

Whilst creating a script I wanted to be able to trace what was happening as the script ran. In my VBScript days I would have set up a flag to determine if I needed verbose output and then tested for it. 59 more words


Fix PowerShell WinRM remote connection errors

I’ve had two annoying PowerShell errors today, both for the same server:

Enter-PSSession : Connecting to remote server server-a.rcmtech.co.uk failed with the
following error message : The client cannot connect to the destination specified in
the request. 469 more words

Azure RMS - File Classification Infrastructure Fail

I’ve been doing a bit of work recently with Azure RMS and FCI (using FSRM) to protect files located on traditional file servers.

One issue I came across whilst following various pieces of guidance which I found online was related to file classification. 235 more words

Certificate Import with PowerShell (Root and Inter)

# Root Cert Import
Import-Certificate -CertStoreLocation cert:\localMachine\ROOT -FilePath “\\server\c$\Install\Software\DSC\EXC2013\Certs\thawte_Primary_Root_CA.cer”

# Inter Cert Import
Import-Certificate -CertStoreLocation cert:\localMachine\CA -FilePath “\\server\c$\Install\Software\DSC\EXC2013\Certs\thawte_SSL_CA_G2.cer”


Unregistering the default repository–PS version dependent?

In this post – https://richardspowershellblog.wordpress.com/2016/09/17/powershell-repositories/ – I stated that you could unregister the default PowerShell repository. I also said that the statement in the documentation for Unregister-PSrepository that you couldn’t unregister PSGallery was incorrect. 462 more words

PowerShell V5

markrobertjohnson reblogged this on Code and commented:

Thanks to Richard for his deep research on this issue ... Using Agent Ransack, I found that the repository data is stored in "c:\Users\\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\PSRepositories.xml" [code language="powershell"] #Script to change the default PSGallery URLs to custom ones (Needed for PowerShell 5.0.10586.117) $xmlPath = "${env:APPDATA}\Microsoft\Windows\PowerShell\PowerShellGet\PSRepositories.xml" -ireplace "Roaming","Local" $config = Import-Clixml -Path $xmlPath $config.Item("PSGallery").SourceLocation = '<YOUR_INTERNAL_PROGET_URL_HERE>' $config.Item("PSGallery").PublishLocation = '<YOUR_INTERNAL_PROGET_URL_HERE>' $config.Item("PSGallery").ScriptSourceLocation = 'https://www.powershellgallery.com/api/v2/items/psscript/' $config.Item("PSGallery").ScriptPublishLocation = 'https://www.powershellgallery.com/api/v2/package/' $config.Item("PSGallery").Trusted = $true $config.Item("PSGallery").Registered = $true $config.Item("PSGallery").InstallationPolicy = 'Trusted' $config.Item("PSGallery").PackageManagementProvider = 'NuGet' $config.Item("PSGallery").ProviderOptions = $config.Item("PSGallery").ProviderOptions Export-Clixml -Path $xmlPath -InputObject $config [/code]

Setting up Local Administrator Password Solution (LAPS)

I decided to spend some time implementing LAPS in my lab as it is Microsoft’s solution to local administrator account password management. Why would I want something like this in my environment? 2,727 more words