Skip to main content

Posts

Create easy to use Excel (csv) from a PowerShell export

Problem I get rusty in between coding projects, and I forget how to do what seems to be basic things like building and exporting a table to CSV for use in Excel or other downstream process/automation/data integration, etc. PowerShell covered Variables simple process for collecting an array of information  Foreach loop @([pscustomobject]@{}) += Export-CSV Logical Process To build a file I can use in Excel, the steps involved are creating an empty variable which I will use as the array to store the table,  Crate an empty variable to store data for later export to the CSV/Table Process to retrieve raw data to process into the CSV/Table for me this is usually Get-ADUser, Get-ADGroupMember, a SQL query, or a request from a SharePoint API for list data for this demonstration we use Get-Process because everyone uses it for demos 😋 Foreach loop to process the raw data gleaning only the data I need for the table += appending each looped occurrence into the CSV/Table @([pscustomobject]...

The Fix: npm ERR! code SELF_SIGNED_CERT_IN_CHAIN [SOLVED]

npm ERR! code SELF_SIGNED_CERT_IN_CHAIN npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN npm ERR! request to https://registry.npmjs.org/gulp-cli failed, reason: self signed certificate in certificate chain What does it even mean? How does one fix this? There are so much information, it's hard to parse what I'm supposed to do. The Solution: Disable the Company VPN This is not ideal and you should work in cooperation with your IT security operations to let them know what you are doing and why you need it. It was reading this article:  https://stackoverflow.com/questions/54611707/request-to-https-registry-npmjs-org-co-failed  and the comments that finally clued me into our VPN causing the conflict. I previously did not have any issues but our company hired a new CISO who has been very active in hardening our corporate environment. What didn't work: gulp untrust-dev-cert Removing package-lock.json file Reinstall Node.js What I wasn't going to try (and you shouldn't either): npm...