Joseph Michael Pesch
VP Programming

Powershell Script to set full access to folders in Windows

by 28. May 2022 18:30

Powershell Script to set full access to folders in Windows:


$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("user_name","FullControl","Allow")

function Get-Folders {


    $list = ''

    $comma = ""

    foreach ($folder in Get-ChildItem -Path $path -Recurse -Directory) {

        Write-Output $folder.FullName

        $ACL = Get-ACL -Path $folder.FullName


        $ACL | Set-Acl -Path $folder.FullName

        Get-Folders $folder.FullName



Get-Folders 'C:\ProgramData\Docker'



XCode - Add AppDelegate.swift and SceneDelegate.swift to SwiftUI Application

by 13. March 2021 13:42

Step 1) Comment out (or remove) the @main code entry point (example below).


structiDineApp: App {

    @StateObject var order = Order()


    var body: some Scene {

        WindowGroup {






Step 2) Add entry shown below to info.plist











                <string>Default Configuration</string>







Step 3) Add AppDelegate.swift

import Foundation

import UIKit



classAppDelegate: UIResponder, UIApplicationDelegate {


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

        // Override point for customization after application launch.




    // MARK: UISceneSession Lifecycle


    func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {

        // Called when a new scene session is being created.

        // Use this method to select a configuration to create the new scene with.

        return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)



    func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {

        // Called when the user discards a scene session.

        // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.

        // Use this method to release any resources that were specific to the discarded scenes, as they will not return.




Step 4) Add SceneDelegate.swift

import UIKit

import SwiftUI


classSceneDelegate: UIResponder, UIWindowSceneDelegate {


    var window: UIWindow?


    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {

        // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.

        // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.

        // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).


        // Create the SwiftUI view that provides the window contents.

        let contentView = ContentView()


        // Use a UIHostingController as window root view controller.

        if let windowScene = scene as? UIWindowScene {

            let window = UIWindow(windowScene: windowScene)

            window.rootViewController = UIHostingController(rootView: contentView)

            self.window = window





    funcsceneDidDisconnect(_ scene: UIScene) {

        // Called as the scene is being released by the system.

        // This occurs shortly after the scene enters the background, or when its session is discarded.

        // Release any resources associated with this scene that can be re-created the next time the scene connects.

        // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).



    funcsceneDidBecomeActive(_ scene: UIScene) {

        // Called when the scene has moved from an inactive state to an active state.

        // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.



    funcsceneWillResignActive(_ scene: UIScene) {

        // Called when the scene will move from an active state to an inactive state.

        // This may occur due to temporary interruptions (ex. an incoming phone call).



    funcsceneWillEnterForeground(_ scene: UIScene) {

        // Called as the scene transitions from the background to the foreground.

        // Use this method to undo the changes made on entering the background.



    funcsceneDidEnterBackground(_ scene: UIScene) {

        // Called as the scene transitions from the foreground to the background.

        // Use this method to save data, release shared resources, and store enough scene-specific state information

        // to restore the scene back to its current state.







Swift | XCode

XCode - Tab Bar View Controller - Add Tab View

by 13. March 2021 11:58

To add an additional tab view:

  1. Add new View Controller to storyboard
  2. CTRL + Drag from the Tab Bar Controller (top left icon) to the new View Controller
  3. Select "View Controller" from the Segue dialog window



XCode Hangs on Startup

by 1. November 2020 15:13

Try deleting this directory:

~/Library/Saved Application State/



Image Test

by 11. September 2020 06:50


Chrome Browser Default Color Blue looks like Purple

by 30. June 2020 09:08

Go to chrome://flags and set the "Force color profile" to sRGB


SQL Server on Mac via Docker to Support .Net SQL Based Project

by 5. May 2020 17:50

To run SQL server on Mac using Docker, follow the steps below.

  1. Download, Install and Run the Docker Desktop Application for Mac:
  2. Open Terminal window and run the following statements:
    1. sudo docker pull

    2. sudo docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD={PASSWORD_HERE}" -p 1433:1433 --name sqlserver -d

    3. docker ps (to see running processes, or use the desktop application dashboard)

To initialize the SQL for .Net project:

  1. Create the following folder if it doesn't already exist: Users/{username}/.microsoft/usersecrets
  2. dotnet user-secrets init
  3. dotnet ef migrations script -i -o migration.sql
  4. dotnet dev-certs https --trust

VS Code Extensions:

  1. ms-dotnettools.csharp
  2. ms-mssql.mssql
  3. esbenp.prettier-vscode
  4. dbaeumer.vscode-eslint


Mac OS | SQL Server

NgCore - Angular App with Dot Net Core

by 8. September 2019 12:57

Before getting started, I recommend looking at using for Command Editor.  


  1. Angular installed globally: 
    npm install -g @angular/cli
  2. Visual Studio Code or Visual Studio Community (or other full version)
  3. Node.js v. 8.10.0 or higher ( to check current version, run command: 
    node -v

Steps to create project:

  1. Create folder for the project, in my case "NgCore"
  2. Run the following command from within the project folder:  
    ng new NgCoreApp
  3. Run the following command from withing the "NgCoreApp" folder: 
    ng build
  4. Run the app from the "dist" folder (created by the "ng build")


Angular | ASP.Net Core

by 8. September 2019 12:54



by 6. September 2019 06:20


MacBook SSD Upgrade

by 28. August 2019 11:36


Mac OS

HTML Textbox Auto Complete

by 15. August 2019 19:44



Postman Collection Runner Save Response Body to Environment Variable

by 9. August 2019 08:14

First, create an environment variable called responseData, with the value [].

Then, add the following code under 'Tests' in Builder. Postman environment variables are intended to be used as string, so we will parse the object then push the JSON responses from the API into the object array.

var jsonData = JSON.parse(responseBody); var old = pm.environment.get("responseData"); old = JSON.parse(old); // filter jsonData if needed

old.push(jsonData); old = JSON.stringify(old); pm.environment.set("responseData", old); console.log(pm.environment.get("responseData")); Now you can retrieve a nested JSON object with all the response data included by viewing the environment variables value (see example below).

Warning: you must reset the responseData value as [] after every use of Collection Runner in order to avoid keeping data from previous runs.



by 21. May 2019 12:40


Python Async without Await

by 19. May 2019 16:26

import asyncio
import time
async def px(x):
    print(x + ': ' + str(time.time()))
async def main():
    x = px('x')
    y = px('y')



Google GSuite Drive File Stream

by 19. May 2019 10:12


Local Cache Location:

  • Win: %USERPROFILE%\AppData\Local\Google\DriveFS
  • Mac: ~/Library/Application Support/Google/DriveFS



Swift IOS UITableViewCell Button

by 5. January 2019 12:40

There are two steps to add a working button to a table view cell. The first step is to add a button like this:

cell.accessoryType = .detailDisclosureButton

The second step is to take action when the button is tapped by creating the accessoryButtonTappedForRowWith method:

override func tableView(_ tableView: UITableView, accessoryButtonTappedForRowWith indexPath: IndexPath) {


XCode | iOS | Swift

xCode Support for IOS Device

by 24. November 2018 06:47

Trying to run xCode against connected iPhone and receive error message below:

Could not locate device support files. This iPhone 6s Plus is running iOS 12.0.1 (16A404), which may not be supported by this version of Xcode.


Download latest xCode from (as .xip file), extract the .app file (

Right click on latest xCode .app and select "Show Package Contents" and navigate to:


Select the required version(s) and copy to:


Look into this path as well: /Users/xxx/Library/Developer/Xcode/iOS DeviceSupport



xCode Facebook Login Integration Using CocoaPods

by 18. November 2018 09:26

Terminal window, navigated to root folder where xCode project exists and run the following commands:

  • $ sudo gem install cocoapods
  • $ pod init

This will create a file named Podfile in your project's root directory. Open the Podfile with a text editor and add the following:

  • pod 'FBSDKLoginKit'

Back in the Terminal window, run the following command:

  • $ pod install 

Register app with Facebook (follow steps in this link:

Configure the information property list file (info.plist) with an XML snippet that contains data about your app. Right-click info.plist, and choose Open As Source Code. Copy and paste the following XML snippet into the body of your file ( ...)


To use any of the Facebook dialogs (e.g., Login, Share, App Invites, etc.) that can perform an app switch to Facebook apps, your application's info.plist also needs to include:


Go to the Project Navigator in Xcode and select your project to see project settings. Select Other Linker Flags for editing. Add the flag -ObjC to Other Linker Flags for all build targets. NOTE: Use the find feature to easily locate the Other Linker Flags in the settins area.

If you still have the xCode project open close it. Open the new Workspace that should have been created in the same root folder as the project (e.g. MyApp.xcodeproj should now have a MyApp.xcworkspace partner).

Update the applications AppDelegate method to include the FBSDKLoginKit import reference and methods with FBSDKApplicationDelegate and FBSDKAppEvents (sample shown below).

import UIKit
import FBSDKLoginKit

class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.

        // FaceBook
        return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
    func applicationWillResignActive(_ application: UIApplication) {
        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.

        // FaceBook
    func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
        return FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)

    func applicationDidEnterBackground(_ application: UIApplication) {
        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

    func applicationWillEnterForeground(_ application: UIApplication) {
        // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.

    func applicationDidBecomeActive(_ application: UIApplication) {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

    func applicationWillTerminate(_ application: UIApplication) {
        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.


Build Project for Running to make sure everything compiles correctly.



Facebook | XCode

Hosted Site Issues with Roslyn - This program is blocked by group policy. For more information, contact your system administrator

by 9. September 2018 12:24
NOTE: Had to remove package: Microsoft.CodeDom.Providers.DotNetCompilerPlatform
      Due to hosting limitation, throwing this error:
      This program is blocked by group policy. For more information, contact your system administrator
      Cannot execute a program. The command being executed was 
              /shared /keepalive:"10" /noconfig  
              /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\bd40b76f\3452b533\33n50imf.cmdline"
NOTE: See nuget url for package details:
NOTE: Some of the new C# 6.0 language features if used in Views (MVC project) will not compile. 
      Many of my views use the ? null checking operator for accessing Model properties.  
      All of these views now return errors on my Godaddy hosted MVC 5 application.
      This error occurs because Views (by default) are compiled at runtime using the .NET pipeline (not pre-compiled).
      To resolve this issue, simply uncheck the "Allow precompiled site to be updatable" option in your publish profile settings.  
      This should pre-compile your views and allow your C# 6.0 (Latest version of Roslyn Compiler) to run like a champ.